{"id":22180552,"url":"https://github.com/s1m0n38/har2py","last_synced_at":"2025-07-26T17:32:16.895Z","repository":{"id":45368917,"uuid":"316840867","full_name":"S1M0N38/har2py","owner":"S1M0N38","description":"Convert .har file in python requests scripts","archived":false,"fork":false,"pushed_at":"2022-10-25T21:02:35.000Z","size":25970,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-05-01T13:53:44.601Z","etag":null,"topics":["chrome-devtools","converter","har","jinja2","networking","requests","selenium"],"latest_commit_sha":null,"homepage":"","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/S1M0N38.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-28T23:30:52.000Z","updated_at":"2023-03-19T19:10:41.000Z","dependencies_parsed_at":"2023-01-20T16:00:42.989Z","dependency_job_id":null,"html_url":"https://github.com/S1M0N38/har2py","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S1M0N38%2Fhar2py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S1M0N38%2Fhar2py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S1M0N38%2Fhar2py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S1M0N38%2Fhar2py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/S1M0N38","download_url":"https://codeload.github.com/S1M0N38/har2py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227700405,"owners_count":17806365,"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":["chrome-devtools","converter","har","jinja2","networking","requests","selenium"],"created_at":"2024-12-02T09:18:38.427Z","updated_at":"2024-12-02T09:18:39.590Z","avatar_url":"https://github.com/S1M0N38.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# har2py\n\nWhen browsing the web with the Developer Tools open you can record the Network\nActivities (requests perform by your browser \u0026 responses you get from servers).\nThen you can export all these data into an [HAR](https://en.wikipedia.org/wiki/HAR_(file_format))\nfile (Http ARchive). With **har2py** you can convert HAR file into valid python\ncode that reproduce the requests perform by your browser.\n\n## Installation\n\nJust a simple pip install, i.e. `python3 -m pip install har2py`\n\n## Usage\n\n1. Navigate the web with your browser while recording your activity. Then save the\ndata in HAR file. Here is an example with Chrome Devs Tools\n![har.gif](https://github.com/S1M0N38/har2py/blob/main/har.gif?raw=true)\n\n2. Go to the directory where is located the har file you want to convert and\ntype\n\n```har2py my_har_file.har```\n\nThis will generate valid python code base on [requests](https://requests.readthedocs.io/en/master/)\nlibrary from *my_har_file.har*. The generated file will be called\n*my_har_file.py* and be located in the same directory of the input file.\n\nAdditional arguemnts are describe in the help\n\n```\n\n\u003e har2py -h\n\nusage: har2py [-h] [-o OUTPUT] [-t TEMPLATE] [-f FILTERS] [-w] input\n\npositional arguments:\n  input                 har input file\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o OUTPUT, --output OUTPUT\n                        py output file. If not the define use the same name of the har\n                        file with py extension.\n  -t TEMPLATE, --template TEMPLATE\n                        jinja2 template used to generate py code. Default to requests.\n                        (For now \"requests\" is the only available template)\n  -f FILTERS, --filters FILTERS\n                        commas value separeted string of the resource type you want to\n                        include in py generated code. Supported type are `xhr`,\n                        `script`, `stylesheet`, `image`, `font`, `document`, `other`.\n                        Default to xhr,document,other.\n  -w, --overwrite       overwrite py file if one previous py file with the same name\n                        already exists.\n\n```\n\n## Similar projects\n\nI like to develope my own program so I can extend easly by adding new jinja2 templates.\nIn the past I use this other projects and from them I have been ispired to build\nhar2py.\n\n- [curlconverter](https://github.com/NickCarneiro/curlconverter):\n  Convert cURL syntax to native Python, Go, PHP, JavaScript, R, Elixir and Dart\n  HTTP code\n- [har2requests](https://github.com/louisabraham/har2requests):\n  Generate Python Requests code from your browser activity\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1m0n38%2Fhar2py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs1m0n38%2Fhar2py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1m0n38%2Fhar2py/lists"}