Skip to main content

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


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)

Uploaded Source

Built Distribution

curlparser-0.1.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page