curlifier


Namecurlifier JSON
Version 0.2.16 PyPI version JSON
download
home_pagehttps://github.com/imtoopunkforyou/curlifier
SummaryConverts Request objects to curl string
upload_time2025-07-19 17:08:04
maintainerNone
docs_urlNone
authorTimur Valiev
requires_python<4.0,>=3.10
licenseMIT
keywords curl curlify to-curl requests request-converter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # curlifier
[![coverage](https://raw.githubusercontent.com/imtoopunkforyou/curlifier/main/.github/badge/coverage.svg)](https://github.com/pytest-dev/pytest-cov)
[![tests](https://github.com/imtoopunkforyou/curlifier/actions/workflows/tests.yaml/badge.svg)](https://github.com/imtoopunkforyou/curlifier/actions/workflows/tests.yaml)
[![pypi package version](https://img.shields.io/pypi/v/curlifier.svg)](https://pypi.org/project/curlifier)
[![pypi downloads](https://img.shields.io/pypi/dm/curlifier.svg)](https://pypi.org/project/curlifier)
[![supported python versions](https://img.shields.io/pypi/pyversions/curlifier.svg)](https://pypi.org/project/curlifier)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)
[![license](https://img.shields.io/pypi/l/curlifier.svg)](https://github.com/imtoopunkforyou/curlifier/blob/main/LICENSE)  

<p align="center">
  <a href="https://pypi.org/project/curlifier">
    <img src="https://raw.githubusercontent.com/imtoopunkforyou/curlifier/main/.github/badge/logo.png"
         alt="Curlifier logo">
  </a>
</p>

Converts the [Request](https://requests.readthedocs.io/en/latest/api/#requests.Response) and [PreparedRequest](https://requests.readthedocs.io/en/latest/api/#requests.PreparedRequest) objects of the [Requests](https://pypi.org/project/requests/) library into an executable [curl](https://curl.se/) command.

## Installation
```bash
pip install curlifier
```

### Dependencies
- `python (>=3.10, <4.0)`
- `requests (>=2.0, <3.0.0)`

## Usage
All you need is to import `curlify`.  
For example:
```python
>>> import requests
>>> from curlifier import curlify
>>> body = {'id': 1, 'name': 'Tima', 'age': 28}
>>> r = requests.post('https://httpbin.org/', json=body)
>>> curlify(r)
curl --request POST 'https://httpbin.org/' <...> --header 'Content-Type: application/json' --data '{"id": 1, "name": "Tima", "age": 28}'
```
If you use `PraparedRequest`, you can also specify it instead of the `Response` object:
```python
>>> req = requests.Request('POST', 'https://httpbin.org/')
>>> r = req.prepare()
>>> curlify(prepared_request=r)
curl --request POST 'https://httpbin.org/'
```
If you want a short version of the curl command, you can specify it:
```python
>>> body = {'id': 1, 'name': 'Tima', 'age': 28}
>>> r = requests.post('https://httpbin.org/', json=body)
>>> curlify(r, shorted=True)
curl -X POST 'https://httpbin.org/' <...> -H 'Content-Type: application/json' -d '{"id": 1, "name": "Tima", "age": 28}'
```
You can also specify the configuration when forming the curl command:
```python
>>> curlify(r, location=True, insecure=True)
curl --request POST 'https://httpbin.org/' <...> --header 'Content-Type: application/json' --data '{"id": 1, "name": "Tima", "age": 28}' --location --insecure
```
- **location** (bool) - Follow redirects (default: False)
- **verbose** (bool) - Verbose output (default: False)
- **silent** (bool) - Silent mode (default: False)
- **insecure** (bool) - Allow insecure connections (default: False)
- **include** (bool) - Include protocol headers (default: False)

## License
Curlifier is released under the MIT License. See the bundled [LICENSE](https://github.com/imtoopunkforyou/curlifier/blob/main/LICENSE) file for details.

The logo was created using [Font Meme](https://fontmeme.com/graffiti-creator/).
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/imtoopunkforyou/curlifier",
    "name": "curlifier",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "curl, curlify, to-curl, requests, request-converter",
    "author": "Timur Valiev",
    "author_email": "cptchunk@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/bd/b9/548351b897299b5e7d6375ffe769dabf7d16f1f5cea60e1f3089e896feed/curlifier-0.2.16.tar.gz",
    "platform": null,
    "description": "# curlifier\n[![coverage](https://raw.githubusercontent.com/imtoopunkforyou/curlifier/main/.github/badge/coverage.svg)](https://github.com/pytest-dev/pytest-cov)\n[![tests](https://github.com/imtoopunkforyou/curlifier/actions/workflows/tests.yaml/badge.svg)](https://github.com/imtoopunkforyou/curlifier/actions/workflows/tests.yaml)\n[![pypi package version](https://img.shields.io/pypi/v/curlifier.svg)](https://pypi.org/project/curlifier)\n[![pypi downloads](https://img.shields.io/pypi/dm/curlifier.svg)](https://pypi.org/project/curlifier)\n[![supported python versions](https://img.shields.io/pypi/pyversions/curlifier.svg)](https://pypi.org/project/curlifier)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n[![license](https://img.shields.io/pypi/l/curlifier.svg)](https://github.com/imtoopunkforyou/curlifier/blob/main/LICENSE)  \n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/curlifier\">\n    <img src=\"https://raw.githubusercontent.com/imtoopunkforyou/curlifier/main/.github/badge/logo.png\"\n         alt=\"Curlifier logo\">\n  </a>\n</p>\n\nConverts the [Request](https://requests.readthedocs.io/en/latest/api/#requests.Response) and [PreparedRequest](https://requests.readthedocs.io/en/latest/api/#requests.PreparedRequest) objects of the [Requests](https://pypi.org/project/requests/) library into an executable [curl](https://curl.se/) command.\n\n## Installation\n```bash\npip install curlifier\n```\n\n### Dependencies\n- `python (>=3.10, <4.0)`\n- `requests (>=2.0, <3.0.0)`\n\n## Usage\nAll you need is to import `curlify`.  \nFor example:\n```python\n>>> import requests\n>>> from curlifier import curlify\n>>> body = {'id': 1, 'name': 'Tima', 'age': 28}\n>>> r = requests.post('https://httpbin.org/', json=body)\n>>> curlify(r)\ncurl --request POST 'https://httpbin.org/' <...> --header 'Content-Type: application/json' --data '{\"id\": 1, \"name\": \"Tima\", \"age\": 28}'\n```\nIf you use `PraparedRequest`, you can also specify it instead of the `Response` object:\n```python\n>>> req = requests.Request('POST', 'https://httpbin.org/')\n>>> r = req.prepare()\n>>> curlify(prepared_request=r)\ncurl --request POST 'https://httpbin.org/'\n```\nIf you want a short version of the curl command, you can specify it:\n```python\n>>> body = {'id': 1, 'name': 'Tima', 'age': 28}\n>>> r = requests.post('https://httpbin.org/', json=body)\n>>> curlify(r, shorted=True)\ncurl -X POST 'https://httpbin.org/' <...> -H 'Content-Type: application/json' -d '{\"id\": 1, \"name\": \"Tima\", \"age\": 28}'\n```\nYou can also specify the configuration when forming the curl command:\n```python\n>>> curlify(r, location=True, insecure=True)\ncurl --request POST 'https://httpbin.org/' <...> --header 'Content-Type: application/json' --data '{\"id\": 1, \"name\": \"Tima\", \"age\": 28}' --location --insecure\n```\n- **location** (bool) - Follow redirects (default: False)\n- **verbose** (bool) - Verbose output (default: False)\n- **silent** (bool) - Silent mode (default: False)\n- **insecure** (bool) - Allow insecure connections (default: False)\n- **include** (bool) - Include protocol headers (default: False)\n\n## License\nCurlifier is released under the MIT License. See the bundled [LICENSE](https://github.com/imtoopunkforyou/curlifier/blob/main/LICENSE) file for details.\n\nThe logo was created using [Font Meme](https://fontmeme.com/graffiti-creator/).",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Converts Request objects to curl string",
    "version": "0.2.16",
    "project_urls": {
        "Homepage": "https://github.com/imtoopunkforyou/curlifier"
    },
    "split_keywords": [
        "curl",
        " curlify",
        " to-curl",
        " requests",
        " request-converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5081966bf99bbd2eb860c2fb0db59649ababbd79fc72a413d1dedcbe7963ffb2",
                "md5": "16c74c5667613f43745c4154fb4b35b7",
                "sha256": "0dcac2315d49c931161f45b7398ab79ae6ce7e26dba406e6f8993d570ff5ba63"
            },
            "downloads": -1,
            "filename": "curlifier-0.2.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "16c74c5667613f43745c4154fb4b35b7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 12129,
            "upload_time": "2025-07-19T17:08:03",
            "upload_time_iso_8601": "2025-07-19T17:08:03.567830Z",
            "url": "https://files.pythonhosted.org/packages/50/81/966bf99bbd2eb860c2fb0db59649ababbd79fc72a413d1dedcbe7963ffb2/curlifier-0.2.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdb9548351b897299b5e7d6375ffe769dabf7d16f1f5cea60e1f3089e896feed",
                "md5": "309433941c0c1830fca8f803e782d395",
                "sha256": "5fd09afe91acdd7e5bf77d1cd7fcd461969d793697dda1c53fc67f861a8e72e3"
            },
            "downloads": -1,
            "filename": "curlifier-0.2.16.tar.gz",
            "has_sig": false,
            "md5_digest": "309433941c0c1830fca8f803e782d395",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 8915,
            "upload_time": "2025-07-19T17:08:04",
            "upload_time_iso_8601": "2025-07-19T17:08:04.924104Z",
            "url": "https://files.pythonhosted.org/packages/bd/b9/548351b897299b5e7d6375ffe769dabf7d16f1f5cea60e1f3089e896feed/curlifier-0.2.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-19 17:08:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "imtoopunkforyou",
    "github_project": "curlifier",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "curlifier"
}
        
Elapsed time: 0.57507s