uncurlx


Nameuncurlx JSON
Version 0.0.13rc1 PyPI version JSON
download
home_pageNone
SummaryUncurl-X is a library that allows you to convert curl requests into python code that uses [httpx](https://www.python-httpx.org/).
upload_time2025-07-30 05:07:25
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords curl http cli command-line uncurl httpx uncurlx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Uncurl-X - Converting curl requests to python httpx requests

[![PyPI - Status](https://img.shields.io/pypi/status/uncurlx?style=flat-square&label=PyPI&)](https://pypi.org/project/uncurlx/)
![Python test Status](https://img.shields.io/github/actions/workflow/status/whichoneiwonder/uncurl-x/python-test.yml?label=Tests&style=flat-square)
![Dependencies Status](https://img.shields.io/github/actions/workflow/status/whichoneiwonder/uncurl-x/dependency-check.yml?label=deps-check&style=flat-square)
<!-- ![GitHub branch status](https://img.shields.io/github/checks-status/whichoneiwonder/uncurl-x/master?style=flat-square) -->
![GitHub License](https://img.shields.io/github/license/whichoneiwonder/uncurl-x?style=flat-square)
![GitHub commit activity](https://img.shields.io/github/commit-activity/t/whichoneiwonder/uncurl-x?style=flat-square)
![Format Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fastral-sh%2Fruff%2Fmain%2Fassets%2Fbadge%2Fv2.json&style=flat-square)


<!-- [![Build Status](https://travis-ci.org/spulec/uncurl.png?branch=master)](https://travis-ci.org/spulec/uncurl) -->

# In a nutshell

Uncurl-X is a library that allows you to convert curl requests into python code that uses [httpx](https://www.python-httpx.org/). Since the Chrome network inspector has a nifty "Copy as cURL", this tool is useful for recreating browser requests in python.

When you don't pass any arguments to `uncurlx`, it will use whatever is in your clipboard as the curl command.

This is a fork of [`uncurl`](https://github.com/spulec/uncurl) by `spulec` which converts from `curl` to `requests`.

## Example

```bash
$ uncurl "curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Cookie: foo=bar;' -H 'Connection: keep-alive' --compressed"
httpx.get("https://pypi.python.org/pypi/uncurlx", headers={
    "Accept-Encoding": "gzip,deflate,sdch",
    "Accept-Language": "en-US,en;q=0.8",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
    "Cache-Control": "max-age=0",
    "Connection": "keep-alive",
}, cookies={
    "foo": "bar",
})
```

The underlying API:

```python
import uncurlx

print(uncurlx.parse("curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch'"))
```

prints the string

```bash
'requests.get("https://pypi.python.org/pypi/uncurlx", headers={
    "Accept-Encoding": "gzip,deflate,sdch",
})'
```

You can also retrieve the components as python objects:

```python
>>> import uncurlx
>>> context = uncurl.parse_context("curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch'")
>>> context.url
https://pypi.python.org/pypi/uncurlx
>>> context.headers
OrderedDict([('Accept-Encoding', 'gzip,deflate,sdch')])
```
On Mac OS, you can also pipe input to uncurlx:

```bash
pbpaste | uncurlx
```

## Install

```console
$ pip install uncurlx
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "uncurlx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "curl, http, cli, command-line, uncurl, httpx, uncurlx",
    "author": null,
    "author_email": "whichoneiwonder <whichoneiwonder@github.com>",
    "download_url": "https://files.pythonhosted.org/packages/c2/3e/a427001742131c657f77736eb69d4ddc435cd06adf74c55f6213dc159fb7/uncurlx-0.0.13rc1.tar.gz",
    "platform": null,
    "description": "# Uncurl-X - Converting curl requests to python httpx requests\n\n[![PyPI - Status](https://img.shields.io/pypi/status/uncurlx?style=flat-square&label=PyPI&)](https://pypi.org/project/uncurlx/)\n![Python test Status](https://img.shields.io/github/actions/workflow/status/whichoneiwonder/uncurl-x/python-test.yml?label=Tests&style=flat-square)\n![Dependencies Status](https://img.shields.io/github/actions/workflow/status/whichoneiwonder/uncurl-x/dependency-check.yml?label=deps-check&style=flat-square)\n<!-- ![GitHub branch status](https://img.shields.io/github/checks-status/whichoneiwonder/uncurl-x/master?style=flat-square) -->\n![GitHub License](https://img.shields.io/github/license/whichoneiwonder/uncurl-x?style=flat-square)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/t/whichoneiwonder/uncurl-x?style=flat-square)\n![Format Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fastral-sh%2Fruff%2Fmain%2Fassets%2Fbadge%2Fv2.json&style=flat-square)\n\n\n<!-- [![Build Status](https://travis-ci.org/spulec/uncurl.png?branch=master)](https://travis-ci.org/spulec/uncurl) -->\n\n# In a nutshell\n\nUncurl-X is a library that allows you to convert curl requests into python code that uses [httpx](https://www.python-httpx.org/). Since the Chrome network inspector has a nifty \"Copy as cURL\", this tool is useful for recreating browser requests in python.\n\nWhen you don't pass any arguments to `uncurlx`, it will use whatever is in your clipboard as the curl command.\n\nThis is a fork of [`uncurl`](https://github.com/spulec/uncurl) by `spulec` which converts from `curl` to `requests`.\n\n## Example\n\n```bash\n$ uncurl \"curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Cookie: foo=bar;' -H 'Connection: keep-alive' --compressed\"\nhttpx.get(\"https://pypi.python.org/pypi/uncurlx\", headers={\n    \"Accept-Encoding\": \"gzip,deflate,sdch\",\n    \"Accept-Language\": \"en-US,en;q=0.8\",\n    \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36\",\n    \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\",\n    \"Cache-Control\": \"max-age=0\",\n    \"Connection\": \"keep-alive\",\n}, cookies={\n    \"foo\": \"bar\",\n})\n```\n\nThe underlying API:\n\n```python\nimport uncurlx\n\nprint(uncurlx.parse(\"curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch'\"))\n```\n\nprints the string\n\n```bash\n'requests.get(\"https://pypi.python.org/pypi/uncurlx\", headers={\n    \"Accept-Encoding\": \"gzip,deflate,sdch\",\n})'\n```\n\nYou can also retrieve the components as python objects:\n\n```python\n>>> import uncurlx\n>>> context = uncurl.parse_context(\"curl 'https://pypi.python.org/pypi/uncurlx' -H 'Accept-Encoding: gzip,deflate,sdch'\")\n>>> context.url\nhttps://pypi.python.org/pypi/uncurlx\n>>> context.headers\nOrderedDict([('Accept-Encoding', 'gzip,deflate,sdch')])\n```\nOn Mac OS, you can also pipe input to uncurlx:\n\n```bash\npbpaste | uncurlx\n```\n\n## Install\n\n```console\n$ pip install uncurlx\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Uncurl-X is a library that allows you to convert curl requests into python code that uses [httpx](https://www.python-httpx.org/).",
    "version": "0.0.13rc1",
    "project_urls": {
        "Home": "https://github.com/whichoneiwonder/uncurl-x"
    },
    "split_keywords": [
        "curl",
        " http",
        " cli",
        " command-line",
        " uncurl",
        " httpx",
        " uncurlx"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "29c751957b477234d659caca904a41868e07d9198546902d00db53baf8a1a80d",
                "md5": "9607e4235f32887344548504e4584965",
                "sha256": "e803c67f5233bd5920efe39f20b66d41b66ef917312a29ff0cb12622f07a7e4a"
            },
            "downloads": -1,
            "filename": "uncurlx-0.0.13rc1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9607e4235f32887344548504e4584965",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 12525,
            "upload_time": "2025-07-30T05:07:24",
            "upload_time_iso_8601": "2025-07-30T05:07:24.291887Z",
            "url": "https://files.pythonhosted.org/packages/29/c7/51957b477234d659caca904a41868e07d9198546902d00db53baf8a1a80d/uncurlx-0.0.13rc1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c23ea427001742131c657f77736eb69d4ddc435cd06adf74c55f6213dc159fb7",
                "md5": "7fafccfc32a981ad50ead58f081255c5",
                "sha256": "1178f16f0d05baddd75e80121f8ed73bdd60017fc4b811646a1f2e189911b50f"
            },
            "downloads": -1,
            "filename": "uncurlx-0.0.13rc1.tar.gz",
            "has_sig": false,
            "md5_digest": "7fafccfc32a981ad50ead58f081255c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11969,
            "upload_time": "2025-07-30T05:07:25",
            "upload_time_iso_8601": "2025-07-30T05:07:25.668763Z",
            "url": "https://files.pythonhosted.org/packages/c2/3e/a427001742131c657f77736eb69d4ddc435cd06adf74c55f6213dc159fb7/uncurlx-0.0.13rc1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 05:07:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "whichoneiwonder",
    "github_project": "uncurl-x",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "uncurlx"
}
        
Elapsed time: 1.96032s