Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arv-anshul/curler

Import curl command in python and use it with requests, httpx, etc. libraries.
https://github.com/arv-anshul/curler

curl curler parser project pycurl pypi pypi-package python3

Last synced: 6 days ago
JSON representation

Import curl command in python and use it with requests, httpx, etc. libraries.

Awesome Lists containing this project

README

        

# curler

Import curl command in python and use it with requests, httpx, etc. libraries.

## ๐ŸŽ‰ Installation

Install **curler** package using `pip` command:

```sh
pip install -U curler
```

## ๐Ÿงฉ Usage

```python
import curler

command = """curl 'https://pypi.python.org/project/arv-easy-analysis' \
-H 'Accept-Encoding:gzip,deflate,sdch' \
-H 'Accept-Language:en-US,en;q=0.8'"""
curler.parse_curl(command)
```

```python
# Output:

ParsedCurl(
method="GET",
url="https://pypi.python.org/project/arv-easy-analysis",
params={},
data=None,
data_binary=None,
headers={
"Accept-Encoding": "gzip,deflate,sdch",
"Accept-Language": "en-US,en;q=0.8",
},
cookies={},
insecure=False,
user=(),
proxy={},
compressed=False,
include=False,
silent=False,
)
```

### ๐Ÿงช You can also check [package tests](./tests/) to gain more insights about this package.

## ๐Ÿ˜Ž Acknowledgment

- ๐Ÿค— This package is heavily inspired by [@spulec/uncurl](https://github.com/spulec/uncurl).