{"id":44296302,"url":"https://github.com/lab-yue/requestify","last_synced_at":"2026-02-11T01:02:24.195Z","repository":{"id":41093449,"uuid":"125850125","full_name":"lab-yue/requestify","owner":"lab-yue","description":"A script to convert cURL into python requests code in few seconds","archived":false,"fork":false,"pushed_at":"2018-05-24T18:23:27.000Z","size":225,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-14T11:37:47.654Z","etag":null,"topics":["curl","python-requests"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lab-yue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-19T11:54:08.000Z","updated_at":"2021-05-28T18:00:05.000Z","dependencies_parsed_at":"2022-07-30T21:18:07.639Z","dependency_job_id":null,"html_url":"https://github.com/lab-yue/requestify","commit_stats":null,"previous_names":["minatsuki-yui/requestify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lab-yue/requestify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-yue%2Frequestify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-yue%2Frequestify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-yue%2Frequestify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-yue%2Frequestify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab-yue","download_url":"https://codeload.github.com/lab-yue/requestify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab-yue%2Frequestify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29323964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T00:34:26.354Z","status":"ssl_error","status_checked_at":"2026-02-11T00:34:09.494Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["curl","python-requests"],"created_at":"2026-02-11T01:01:00.778Z","updated_at":"2026-02-11T01:02:24.179Z","avatar_url":"https://github.com/lab-yue.png","language":"Python","readme":"\u003ch2\u003eDescription:\u003c/h2\u003e\n\n\u003cp style=\"font-size: 20px\"\u003eA scaffold to convert cURL into python requests code in few seconds\u003c/p\u003e\n\n\u003ch2\u003eInstall:\u003c/h2\u003e\n\n`pip(3) install requestify`\n\n\u003ch2\u003eUsage:\u003c/h2\u003e\n\nThere are two ways of input and output: \n\nInput :     \n\n+ **from_clipboard**       \u0026nbsp;##(windows not tested)\n+  **from_string('...your_string...')**\n\noutput:  \n\n+ **to_file('...your_file_name...')**\n+ **to_current_file()**\n\n\u003ch2\u003eExamples:\u003c/h2\u003e\n\n\u003ch3\u003e1.copy cURL from Chrome \u003c/h3\u003e\n\n![](./imgs/img1.png)\n\n\n\u003ch3\u003e2.create a new script \u003c/h3\u003e\n\n```python\nimport requestify\n\nrequestify.from_clipboard.to_file('new_request.py')\n```\n\nThis will write to a new file \n\nor \n\n```python\nimport requestify\n\nrequestify.from_clipboard.to_current_file()\n```\n\nThis will overwrite the current file with new code\n\n\u003ch4\u003eIf you want to use from_string() , paste your cURL into a new string variable.\u003c/h4\u003e\n\n\u003ch5\u003eExample:\u003c/h5\u003e\n\n```python\nimport requestify\n\nbase_string = '''\n\ncurl 'https://github.com/' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: zh-CN,zh;q=0.9,ja;q=0.8,en;q=0.7' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'Cache-Control: no-cache' -H 'Cookie: .............' -H 'Connection: keep-alive' --compressed\n\n'''\n\nrequestify.from_string(base_string).to_current_file()\n\n```\n\n\u003ch3\u003e3.run it \u003c/h3\u003e\n\n\u003ch3\u003e4.you will get this \u003c/h3\u003e\n\n```python\nimport requests\n\n\nheaders = {'Pragma': 'no-cache',\n           'Accept-Encoding': 'gzip, deflate, br',\n           'Accept-Language': 'zh-CN,zh;q=0.9,ja;q=0.8,en;q=0.7',\n           'Upgrade-Insecure-Requests': '1',\n           'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36',\n           'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',\n           'Cache-Control': 'no-cache',\n           'Connection': 'keep-alive'\n           }\n\ncookies = {'_octo': '............',\n           '_ga': '............',\n           'user_session': '............',\n           '__Host-user_session_same_site': '............',\n           'logged_in': '............',\n           'dotcom_user': '............',\n           'tz': '............',\n           '_gat': '............',\n           '_gh_sess': '............'\n           }\n\nresponse = requests.get('https://github.com/', headers=headers, cookies=cookies)\n```\n\n\u003ch2\u003eOptions:\u003c/h2\u003e\n\nyou can set `with_cookies` or `with_headers` to `False` to disable cookies or headers code generation \n\n```python\nrequestify.from_clipboard.to_current_file(with_cookies=False,with_headers=False)\n```\n\nor \n\n```python\nrequestify.from_clipboard.to_file('new_request.py', with_cookies=False,with_headers=False)\n```\n\n\u003ch2\u003eAppendix:\u003c/h2\u003e\n\nyou can also access the url , headers , cookies as python variables without writing them to a file\n\nfor instance:\n\n```python\nimport requestify\n\ndata = requestify.from_clipboard\n\nprint(data.url)\n# https://github.com/\nprint(data.headers)\n# {'Pragma': 'no-cache', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9,ja;q=0.8,en;q=0.7', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive'}\nprint(data.cookies)\n# {'_octo': '............', '_ga': '............', 'user_session': '............', '__Host-user_session_same_site': '............', 'logged_in': '............', 'dotcom_user': '............', 'tz': '............', '_gat': '............', '_gh_sess': '............'}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab-yue%2Frequestify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab-yue%2Frequestify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab-yue%2Frequestify/lists"}