{"id":14989960,"url":"https://github.com/lispython/human_curl","last_synced_at":"2025-04-05T18:07:51.719Z","repository":{"id":1622279,"uuid":"2301866","full_name":"Lispython/human_curl","owner":"Lispython","description":"Simple Human wrapper for cURL library","archived":false,"fork":false,"pushed_at":"2021-02-03T20:12:11.000Z","size":232,"stargazers_count":204,"open_issues_count":23,"forks_count":40,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-05T18:07:35.392Z","etag":null,"topics":["curl","curl-library","python","requests"],"latest_commit_sha":null,"homepage":"http://h.wrttn.me/human_curl","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lispython.png","metadata":{"files":{"readme":"README.rst","changelog":"ChangeLog","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":"2011-08-31T14:09:17.000Z","updated_at":"2024-11-28T16:29:05.000Z","dependencies_parsed_at":"2022-08-08T09:01:52.584Z","dependency_job_id":null,"html_url":"https://github.com/Lispython/human_curl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lispython%2Fhuman_curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lispython%2Fhuman_curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lispython%2Fhuman_curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lispython%2Fhuman_curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lispython","download_url":"https://codeload.github.com/Lispython/human_curl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378142,"owners_count":20929296,"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":["curl","curl-library","python","requests"],"created_at":"2024-09-24T14:19:14.390Z","updated_at":"2025-04-05T18:07:51.692Z","avatar_url":"https://github.com/Lispython.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Welcome to human_curl's documentation!\n======================================\n\nCurl requests for Humans\n\nhuman_curl allow you to send  **HEAD**, **GET**, **POST**, **PUT**,\n**OPTIONS**, and **DELETE** HTTP requests.\n\n.. image:: https://secure.travis-ci.org/Lispython/human_curl.png\n\t   :target: https://secure.travis-ci.org/Lispython/human_curl\n\nFeatures\n--------\n\n- Custom HTTP headers\n- Request data/params\n- Multiple file uploading\n- Async requests!\n- Cookies support (dict or CookieJar)\n- Redirection history\n- Proxy support (http, https, socks4/5)\n- Custom interface for request!\n- Auto decompression of GZipped content\n- Unicode URL support\n- Request timers and another info\n- Certificate validation\n- ipv6 support\n- Basic/Digest authentication\n- OAuth support!\n- Debug request and response headers\n- .netrc support\n\n\nUsage\n-----\n\n\n**Simple get request**\n\n    \u003e\u003e\u003e import human_curl as requests # python-requests.org compatibile\n    \u003e\u003e\u003e # import human_curl as hurl # unfortunately hurl.it keeps this name :-)\n    \u003e\u003e\u003e r = hurl.get('http://h.wrttn.me/basic-auth/test_username/test_password',\n    ... auth=('test_username', 'test_password'))\n    \u003e\u003e\u003e r.status_code\n    200\n    \u003e\u003e\u003e r.content\n    '{\"username\": \"test_username\", \"password\": \"test_password\", \"authenticated\": true}'\n\n**Cookies and headers**\n\n    \u003e\u003e\u003e import human_curl as hurl # python-requests.org compatibile\n    \u003e\u003e\u003e r = hurl.get(\"http://h.wrttn.me/cookies/set/ajfwjlknefjrrf/fkjwnfklrnjge\")\n    \u003e\u003e\u003e r.cookies\n        {'ajfwjlknefjrrf': 'fkjwnfklrnjge'}\n    \u003e\u003e\u003e r.headers['etag']\n        bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f\n    \u003e\u003e\u003e r.headers\n        {'connection': 'keep-alive',\n         'content-length': '2',\n         'content-type': 'text/html; charset=UTF-8',\n         'date': 'Mon, 05 Sep 2011 20:28:47 GMT',\n         'etag': 'bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f',\n         'server': 'LightBeer/0.568'}\n\n\n\n\n**Send files and variables**\n\n    \u003e\u003e\u003e import human_curl as hurl\n    \u003e\u003e\u003e r = hurl.post('http://h.wrttn.me/post', files=(('file_1', '/tmp/testfile1.txt'),\n    ... ('file2', open('/tmp/testfile2.txt'))), data={'var_name': 'var_value'})\n    \u003e\u003e\u003e r.status_code\n    201\n\n\n**Redirects**\n\n    \u003e\u003e\u003e import human_curl as hurl\n    \u003e\u003e\u003e r = hurl.get('http://h.wrttn.me/redirect/4', allow_redirects=True)\n    \u003e\u003e\u003e r.status_code\n    200\n    \u003e\u003e\u003e print(r.history)\n\t['http://h.wrttn.me/redirect/3', 'http://h.wrttn.me/redirect/2',\n     'http://h.wrttn.me/redirect/1', 'http://h.wrttn.me/redirect/end']\n    \u003e\u003e\u003e print(r.url)\n\thttp://h.wrttn.me/redirect/end\n\n\n**Auth managers**\n\n    \u003e\u003e\u003e import human_curl as hurl\n    \u003e\u003e\u003e from human_curl.auth import BasicAuth, DigestAuth\n    \u003e\u003e\u003e auth_manager = DigesAuth('username', 'password')\n    \u003e\u003e\u003e r = hurl.post('http://h.wrttn.me/digest-auth/auth/username/password',\n    ... auth=auth_manager)\n    \u003e\u003e\u003e r.status_code\n    200\n    \u003e\u003e\u003e basic_auth_manager = BasicAuth('username', 'password')\n    \u003e\u003e\u003e r = hurl.post('http://h.wrttn.me/basic-auth/username/password',\n    ... auth=basic_auth_manager)\n    \u003e\u003e\u003e r.status_code\n    200\n    \u003e\u003e\u003e oauth_manager = OAuthManager((CONSUMER_KEY, CONSUMER_SECRET), (TOKEN_KEY, TOKEN_SECRET))\n    \u003e\u003e\u003e r = hurl.get('http://oauth-protected.com/resource', auth=oauth_manager)\n    \u003e\u003e\u003e r.status_code\n    200\n\n**Debug requests**\n\n    \u003e\u003e\u003e import human_curl as hurl\n    \u003e\u003e\u003e # stdout_debug(debug_type, debug_msg)\n    \u003e\u003e\u003e r = hurl.get(\"https://h.wrttn.me/basic-auth/username/password\",\n    ... debug=stdout_debug, allow_redirects=False,\n    ... auth=(\"username\", \"password\"))\n    \u003e\u003e\u003e print(r.status_code)\n    200\n\n\n**Async requests**\n\n    \u003e\u003e\u003e from human_curl.async import AsyncClient\n    \u003e\u003e\u003e async_client = AsyncClient(success_callback=lambda **kw: print kw,\n    ... fail_callback=lambda **kw: print kw)\n    \u003e\u003e\u003e async_client.get('http://h.wrttn.me/get')\n    \u003e\u003e\u003e async_client.get('http://httpbin.org/get',\n    ... success_callback=lambda **kw: print(\"success!\"),\n    ... fail_callback=lambda **kw: print(\"fail!\")\n    \u003e\u003e\u003e async_client.start()\n\n\n\nTODO\n----\n\n- curl command generation?\n\n\nINSTALLATION\n------------\n\nTo use human_curl use pip or easy_install:\n\n`pip install human_curl`\n\nor\n\n`easy_install human_curl`\n\n\nCONTRIBUTE\n----------\n\nFork https://github.com/Lispython/human_curl/ , create commit and pull request to ``develop``.\n\n\nSEE ALSO\n--------\n\nIf you don't like cURL (why?), try to use `python-requests`_.\n\n.. _`python-requests`: http://python-requests.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flispython%2Fhuman_curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flispython%2Fhuman_curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flispython%2Fhuman_curl/lists"}