curlifier


Namecurlifier JSON
Version 0.2.17 PyPI version JSON
download
home_pagehttps://github.com/imtoopunkforyou/curlifier
SummaryConverts Request objects to curl string
upload_time2025-07-27 12:09:32
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
```

## ⚠️ Security Warning

The resulting curl command will include all authentication credentials, API keys, passwords, and other sensitive information that were part of the original request. Be careful when sharing or logging these commands, as they may expose sensitive data.

## 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 `PreparedRequest`, 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/d3/5a/982456ce9d517c6dd5ad19e8c221563f3b2a813455d3ae9d9d6b2a2a96dc/curlifier-0.2.17.tar.gz",
    "platform": null,
    "description": "# curlifier\n\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\n```bash\npip install curlifier\n```\n\n## \u26a0\ufe0f Security Warning\n\nThe resulting curl command will include all authentication credentials, API keys, passwords, and other sensitive information that were part of the original request. Be careful when sharing or logging these commands, as they may expose sensitive data.\n\n## Usage\n\nAll you need is to import `curlify`.  \nFor example:\n\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```\n\nIf you use `PreparedRequest`, you can also specify it instead of the `Response` object:\n\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```\n\nIf you want a short version of the curl command, you can specify it:\n\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```\n\nYou can also specify the configuration when forming the curl command:\n\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\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\n\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/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Converts Request objects to curl string",
    "version": "0.2.17",
    "project_urls": {
        "Homepage": "https://github.com/imtoopunkforyou/curlifier"
    },
    "split_keywords": [
        "curl",
        " curlify",
        " to-curl",
        " requests",
        " request-converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8993dc086a752c9771e1d9cb7e4d6137d5576471074ebe267e21bd1cb56ffeac",
                "md5": "8c22591ef3f8f09f0218a2ee3392fe29",
                "sha256": "767ead308019838ac5cd60aa2c72c7c333407c863af64b4180755c6f09d93104"
            },
            "downloads": -1,
            "filename": "curlifier-0.2.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c22591ef3f8f09f0218a2ee3392fe29",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 12535,
            "upload_time": "2025-07-27T12:09:30",
            "upload_time_iso_8601": "2025-07-27T12:09:30.769840Z",
            "url": "https://files.pythonhosted.org/packages/89/93/dc086a752c9771e1d9cb7e4d6137d5576471074ebe267e21bd1cb56ffeac/curlifier-0.2.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d35a982456ce9d517c6dd5ad19e8c221563f3b2a813455d3ae9d9d6b2a2a96dc",
                "md5": "7a93601d5a4ca248a7e54228d433bc59",
                "sha256": "e6b0a482a0fdbebbd107b7d4c9c7eab9846e01623fa11e91e72165fc0222cf9f"
            },
            "downloads": -1,
            "filename": "curlifier-0.2.17.tar.gz",
            "has_sig": false,
            "md5_digest": "7a93601d5a4ca248a7e54228d433bc59",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 9078,
            "upload_time": "2025-07-27T12:09:32",
            "upload_time_iso_8601": "2025-07-27T12:09:32.094697Z",
            "url": "https://files.pythonhosted.org/packages/d3/5a/982456ce9d517c6dd5ad19e8c221563f3b2a813455d3ae9d9d6b2a2a96dc/curlifier-0.2.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-27 12:09:32",
    "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: 1.12364s