Parse cURL commands returning object representing the request.
Project description
cURL Parser
Parse cURL commands returning object representing the request.
How to install?
curlparser
is available on PyPi:
Using pip
$ pip install curlparser
Using poetry
$ poetry add curlparser
Using pipenv
$ pipenv install curlparser
How to use?
>>> import curlparser
>>> result = curlparser.parse(
"""
curl \
--header 'Content-Type: application/json' \
--request PUT \
--user nlecoy:my_password \
--data '{"username":"xyz", "password":"xyz"}' \
https://api.github.com/repos/nlecoy/curlparser
"""
)
>>> result.url
'https://api.github.com/repos/nlecoy/curlparser'
>>> result.auth
('nlecoy', 'my_password')
>>> result.json
{'username': 'xyz', 'password': 'xyz'}
Available parameters
curlparser
's parse method will return a ParsedCommand
object containing the following fields:
- method
- url
- auth
- cookies
- data
- json
- header
- verify
License
cURL Parser is distributed under the Apache 2.0. See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
curlparser-0.1.0.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for curlparser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d2020367571fc02dbab0e583ff52a8e31d13e05bbd5dbb893aa75322744f527 |
|
MD5 | 7168282dcd35e5e6b31a5ea2dec1b880 |
|
BLAKE2b-256 | d1957064417db2c45b91fab6547c09ec27092ef32ac87d0ac7300d88266da1de |