aggregation_modules/custom_functions.py
def parse_user_agent(user_agent):
    """
    returns platform, os, browser distribution details.
    sample output,
    ```
    "platform": {
      "Windows": 30
    },
    "os": {
      "Windows": 30
    },
    "browser": {
      "Chrome": 30
    }
    ```
    """
    ua_info = (
        "os",
        "browser",
        "platform",
    )
    client_info = {}
    for to_extract in ua_info:
        client_info[to_extract] = user_agent.apply(
            extract_from_ua, args=(to_extract,))
        # convert to json
        client_info[to_extract] = json.loads(
            client_info[to_extract].value_counts().to_json()
        )
    return client_info

    returns platform, os, browser distribution details.
    sample output,
    ```
    "platform": {
      "Windows": 30
    },
    "os": {
      "Windows": 30
    },
    "browser": {
      "Chrome": 30
    }
    ```
    
returns platform, os, browser distribution details.
returns platform os browser distribution details .
def parse_user_agent(user_agent):
    ua_info = (
        "os",
        "browser",
        "platform",
    )
    client_info = {}
    for to_extract in ua_info:
        client_info[to_extract] = user_agent.apply(
            extract_from_ua, args=(to_extract,))
        client_info[to_extract] = json.loads(
            client_info[to_extract].value_counts().to_json()
        )
    return client_info
def parse_user_agent ( user_agent ) : ua_info = ( "os" , "browser" , "platform" , ) client_info = { } for to_extract in ua_info : client_info [ to_extract ] = user_agent . apply ( extract_from_ua , args = ( to_extract , ) ) client_info [ to_extract ] = json . loads ( client_info [ to_extract ] . value_counts ( ) . to_json ( ) ) return client_info
returns platform, os, browser distribution details.
returns platform os browser distribution details .
"""
    returns platform, os, browser distribution details.
    sample output,
    ```
    "platform": {
      "Windows": 30
    },
    "os": {
      "Windows": 30
    },
    "browser": {
      "Chrome": 30
    }
    ```
    """ # convert to json
user_agent