{"id":16992567,"url":"https://github.com/bharat23/wpt-parser","last_synced_at":"2026-05-15T21:07:47.279Z","repository":{"id":44867928,"uuid":"265070412","full_name":"Bharat23/wpt-parser","owner":"Bharat23","description":"A python package to fetch and extract test results from Webpagetest, speed curve and other webpagetest backed products.","archived":false,"fork":false,"pushed_at":"2022-12-08T09:55:44.000Z","size":1331,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T00:42:51.272Z","etag":null,"topics":["json","parser","python3","speedcurve","webpagetest"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/wpt-parser/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bharat23.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":"CONTRIBUTING.MD","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-18T21:48:09.000Z","updated_at":"2021-11-03T19:57:19.000Z","dependencies_parsed_at":"2023-01-25T06:30:09.460Z","dependency_job_id":null,"html_url":"https://github.com/Bharat23/wpt-parser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bharat23%2Fwpt-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bharat23%2Fwpt-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bharat23%2Fwpt-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bharat23%2Fwpt-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bharat23","download_url":"https://codeload.github.com/Bharat23/wpt-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907378,"owners_count":20529851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","parser","python3","speedcurve","webpagetest"],"created_at":"2024-10-14T03:29:26.231Z","updated_at":"2026-05-15T21:07:47.232Z","avatar_url":"https://github.com/Bharat23.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WPT Parser\n[![PyPI version](https://badge.fury.io/py/wpt-parser.svg)](https://badge.fury.io/py/wpt-parser)\n[![Upload Python Package](https://github.com/Bharat23/wpt-parser/actions/workflows/python-publish.yml/badge.svg)](https://github.com/Bharat23/wpt-parser/actions/workflows/python-publish.yml)\n\n- ## [Getting Started](#getting-started)\n    * [Prerequiste](#prerequiste)\n    * [Installation](#installation)\n    * [Examples](#example)\n        * [Key Types](#key-type)\n- ## [Available Methods](#available-methods)\n\n## Getting Started\n\n- ### Prerequisites\n    - Python \u003e= 3.6.x\n    - pip\n\n- ### Installation\n    ```\n    $ pip install wpt-parser\n    ```\n\n- ### Examples\n    - Using the JSON Parser\n    ```\n    # import the class\n    from WPTParser.Fetch import Fetch\n    from WPTParser.JSONParser import JSONParser\n    \n    test_json = Fetch().json()\n    keys = ['data.median.firstView.loadTime',]\n    # returns a new dict with specified keys\n    JSONParser(test_json).pick(keys=keys).exec()\n\n    ```\n- ### Key Types:\n    - #### key_name\n        - Works like simple JSON extraction. Provide the name of the key and boom!.\n        - For extraction from beyond first level, append keys with a separator and provide `key_delimiter` for the program to recognize the start of next level.\n        - Example: \n        ```\n        \"\"\"\n        {\n            keylevel11: {\n                keylevel21: value,\n                keylevel22: {\n                    keylevel31: value\n                }\n            }\n        }\n        \"\"\"\n        # key to extract first level\n        # keylevel11\n        # returns {keylevel21: ...}\n\n        # key to extract second level, first key\n        # keylevel11.keylevel21\n        # returns value\n        ```\n    - #### [list_index]\n        - When you have a list as value and you want to extract a specific index value/object.\n        - For extraction from beyond first level, append keys with a separator and provide `key_delimiter` for the program to recognize the start of next level.\n        - Example: \n        ```\n        \"\"\"\n        {\n            keylevel11: {\n                keylevel21: [\n                    1, 2, 3\n                ],\n                keylevel22: {\n                    keylevel31: value\n                }\n            }\n        }\n        \"\"\"\n        # key to extract second level, third index\n        # keylevel11.keylevel21.[2]\n        # returns 3\n        ```\n    - #### [{key=value}]\n        - When you have a unordered list of object and you want extract a specific object from the list based on the key and value inside the object\n        - For extraction from beyond first level, append keys with a separator and provide `key_delimiter` for the program to recognize the start of next level.\n        - Example: \n        ```\n        \"\"\"\n        {\n            keylevel11: {\n                keylevel21: [\n                    1, 2, 3\n                ],\n                keylevel22: {\n                    keylevel31: value\n                },\n                keylevel23: [\n                    {\n                        name: Awesome,\n                    },\n                    {\n                        name: Package\n                    }\n                ]\n            }\n        }\n        \"\"\"\n        # key to extract second level, and from that extarct the object with name = Awesome\n        # keylevel11.keylevel23.[{name=Awesome}]\n        # return {name: Awesome}\n        ```\n    \n    - #### [{key~regex}]\n        - When you have a unordered list of object and you want extract a specific object from the list based on the key and a regex of value inside the object\n        - For extraction from beyond first level, append keys with a separator and provide `key_delimiter` for the program to recognize the start of next level.\n        - The regex search is case sensitive. You do not need to add `//` or `r''` to write your regex.\n        - The search will find all the matches and return a list\n        - Example: \n        ```\n        \"\"\"\n        {\n            keylevel11: {\n                keylevel21: [\n                    1, 2, 3\n                ],\n                keylevel22: {\n                    keylevel31: value\n                },\n                keylevel23: [\n                    {\n                        name: Awesome123,\n                    },\n                    {\n                        name: Package\n                    }\n                ]\n            }\n        }\n        \"\"\"\n        # key to extract second level, and from that extarct the object with name matching Awesome\n        # keylevel11.keylevel23.[{name~Awesome}]\n        # return [{name: Awesome}]\n        ```\n\n### Available Methods\n\n- JSONParser\n\n| Method | Params | type | default | Description \n| --- | --- | --- | --- | --- |\n| pick | key | str | None | selects a key to be returned\n| pick | keys | list | [] | selects a list key to be returned\n| pick | key_delimiter | str | \".\" | Separator used to identify multi level JSON\n| pick | key_mapping | dict | {} | Mapping of keys for picking with custom key name. \n\n- Fetch\n\n| Method | Params | type | default | Description \n| --- | --- | --- | --- | --- |\n| json | test_id | str | None | test_id for a wpt or a speed curve test\n| json | WPT_URI | str | 'https://webpagetest.org' | URI for your WPT instance\n\n### Note:\n - The package is under development and will be prone to more frequent updates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbharat23%2Fwpt-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbharat23%2Fwpt-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbharat23%2Fwpt-parser/lists"}