The library convert python 'requests' and 'httpx' object in curl command. Curlify2 is a enhancement of [curlify]('https://github.com/ofw/curlify').
## Installation
To install the library use pip or poetry command, see:
```bash
$ pip install curlify2
```
or poetry:
```bash
$ poetry add curlify2
```
## Usage
using **requests** module:
```python
from curlify2 import Curlify
import requests
URL = "https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f"
request = requests.get(URL)
response = Curlify(request.request)
print(response.to_curl()) # curl -X GET -H "User-Agent: python-requests/2.24.0" -H "Accept-Encoding: gzip, deflate" -H "Accept: */*" -H "Connection: keep-alive" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f
```
using **httpx** module:
```python
import curlify2
import httpx
URL = "https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f"
request = httpx.get(URL)
response = Curlify(request.request)
print(response.to_curl()) # curl -X GET -H "User-Agent: python-requests/2.24.0" -H "Accept-Encoding: gzip, deflate" -H "Accept: */*" -H "Connection: keep-alive" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f
```
Raw data
{
"_id": null,
"home_page": "https://github.com/marcuxyz/curlify2",
"name": "curlify2",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "python,curl,requests,curlify,httpx,convert to curl",
"author": "Marcus Pereira",
"author_email": "marcus@negros.dev",
"download_url": "https://files.pythonhosted.org/packages/91/24/3803baab3519ee855b6f6f6a81dca7af1ff8640bccb177765a227df9f835/curlify2-2.0.0.tar.gz",
"platform": null,
"description": "The library convert python 'requests' and 'httpx' object in curl command. Curlify2 is a enhancement of [curlify]('https://github.com/ofw/curlify').\n\n\n## Installation\n\nTo install the library use pip or poetry command, see:\n\n```bash\n$ pip install curlify2\n```\n\nor poetry:\n\n```bash\n$ poetry add curlify2\n```\n\n## Usage\n\nusing **requests** module:\n\n```python\nfrom curlify2 import Curlify\nimport requests\n\nURL = \"https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f\"\n\nrequest = requests.get(URL)\nresponse = Curlify(request.request)\n\nprint(response.to_curl()) # curl -X GET -H \"User-Agent: python-requests/2.24.0\" -H \"Accept-Encoding: gzip, deflate\" -H \"Accept: */*\" -H \"Connection: keep-alive\" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f\n```\n\nusing **httpx** module:\n\n```python\nimport curlify2\nimport httpx\n\nURL = \"https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f\"\n\nrequest = httpx.get(URL)\nresponse = Curlify(request.request)\n\nprint(response.to_curl()) # curl -X GET -H \"User-Agent: python-requests/2.24.0\" -H \"Accept-Encoding: gzip, deflate\" -H \"Accept: */*\" -H \"Connection: keep-alive\" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Library to convert python requests and httpx object to curl command.",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/marcuxyz/curlify2",
"Repository": "https://github.com/marcuxyz/curlify2"
},
"split_keywords": [
"python",
"curl",
"requests",
"curlify",
"httpx",
"convert to curl"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "43db8428ec3fa111a69db05de651ac7378b3b3eb8b558dd1cd7d262f4904c200",
"md5": "bdbfbd06adfcddaa2b16e92acf6b3549",
"sha256": "23878b13fa33ed92ae5dff0476e5b881b39fc79a5fcb37e6726f96239a136474"
},
"downloads": -1,
"filename": "curlify2-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bdbfbd06adfcddaa2b16e92acf6b3549",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 3085,
"upload_time": "2023-06-09T15:17:30",
"upload_time_iso_8601": "2023-06-09T15:17:30.459028Z",
"url": "https://files.pythonhosted.org/packages/43/db/8428ec3fa111a69db05de651ac7378b3b3eb8b558dd1cd7d262f4904c200/curlify2-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "91243803baab3519ee855b6f6f6a81dca7af1ff8640bccb177765a227df9f835",
"md5": "25f4692a160980b56e7bd025cc89bedd",
"sha256": "6c3a98dc8603b76da990f58754b18ec4e9bfe5b881fc52d33ddf9d9096568809"
},
"downloads": -1,
"filename": "curlify2-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "25f4692a160980b56e7bd025cc89bedd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 2537,
"upload_time": "2023-06-09T15:17:32",
"upload_time_iso_8601": "2023-06-09T15:17:32.329801Z",
"url": "https://files.pythonhosted.org/packages/91/24/3803baab3519ee855b6f6f6a81dca7af1ff8640bccb177765a227df9f835/curlify2-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-09 15:17:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "marcuxyz",
"github_project": "curlify2",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "curlify2"
}