{"id":16563875,"url":"https://github.com/kanzure/python-requestions","last_synced_at":"2025-10-28T23:31:32.014Z","repository":{"id":6661962,"uuid":"7906568","full_name":"kanzure/python-requestions","owner":"kanzure","description":"Serialization for python-requests based on JSON.","archived":false,"fork":false,"pushed_at":"2013-08-05T06:10:05.000Z","size":89,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T20:21:09.511Z","etag":null,"topics":[],"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/kanzure.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":"2013-01-30T02:54:21.000Z","updated_at":"2022-06-22T19:38:49.000Z","dependencies_parsed_at":"2022-09-17T04:30:52.440Z","dependency_job_id":null,"html_url":"https://github.com/kanzure/python-requestions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzure%2Fpython-requestions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzure%2Fpython-requestions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzure%2Fpython-requestions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzure%2Fpython-requestions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanzure","download_url":"https://codeload.github.com/kanzure/python-requestions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238738090,"owners_count":19522309,"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":[],"created_at":"2024-10-11T20:42:32.101Z","updated_at":"2025-10-28T23:31:31.721Z","avatar_url":"https://github.com/kanzure.png","language":"Python","readme":"# Requestions\n\nRequestions is a serialization library for [Requests](https://github.com/kennethreitz/requests) using JSON. Also, requestions includes a decorator called httpetrified for storing responses and replaying them in the future for HTTP testing without the live interwebz.\n\n## Installing\n\nSimple.\n\n``` bash\nsudo pip install requestions\n```\n\nor,\n\n``` bash\nsudo python setup.py install\n```\n\n## Usage\n\n``` python\n# responses\noriginal_response = requests.get(\"http://httpbin.org/get\")\nserialized_response = requestions.write_response(original_response)\nresponse = requestions.read_response(serialized_response)\n\n# requests\noriginal_request = requests.models.Request(url=\"http://httpbin.org/post\", method=\"POST\")\nserialized_request = requestions.write_request(original_request)\nrequest = requestions.read_request(serialized_request)\n```\n\n## Decorator\n\nSave responses in a json file, then use them later to make unit testing not so miserable.\n\n``` python\nimport json\nimport requests\nfrom requestions import httpetrified\n\ndef get_current_ip_address(self):\n    \"Abuses some poor sap's ip address detection service.\"\n    response = requests.get(\"http://jsonip.com\")\n    return response.json()[\"ip\"]\n\n@httpetrified(\"samples/helpers/jsonip-request.json\")\ndef test_get_current_ip_address(self):\n    self.assertEqual(\"127.0.0.1\", get_current_ip_address())\n```\n\n## Changelog\n\n* 0.0.7 - fix CaseInsensitiveDict problem\n* 0.0.5 - fix broken setup.py, gah\n* 0.0.4 - fix test for both requests==0.14.2 and requests\u003e=1.0.3\n* 0.0.3 - httpetrified decorator\n* 0.0.1 - initial commit\n\n## Alternatives\n\n* [requests-vcr](https://github.com/sigmavirus24/requests-vcr)\n\n## Related\n\n* [HTTPretty](https://github.com/gabrielfalcao/HTTPretty)\n\n## TODO\n\n* support multiple requests/responses in a single json file. This will allow a\n  single test to cause multiple requests to be made that can all be mocked\n  simultaneously.\n\n* support streaming http responses like HTTPretty does\n\n## License\n\nBSD.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanzure%2Fpython-requestions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanzure%2Fpython-requestions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanzure%2Fpython-requestions/lists"}