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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file curlparser-0.1.0.tar.gz.

File metadata

  • Download URL: curlparser-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.1 Darwin/20.2.0

File hashes

Hashes for curlparser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6cb7b675ed7c08338f2ce0ba64012aa3b9e908577d1f54c8f5f94a3057099ae
MD5 dc7bd5585c35573800071c5ec109fb3e
BLAKE2b-256 e6e2c1e12c18eed63a64e2e912cbd56f7ba97e498164cfe361797141ea457856

See more details on using hashes here.

File details

Details for the file curlparser-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: curlparser-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.1 Darwin/20.2.0

File hashes

Hashes for curlparser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d2020367571fc02dbab0e583ff52a8e31d13e05bbd5dbb893aa75322744f527
MD5 7168282dcd35e5e6b31a5ea2dec1b880
BLAKE2b-256 d1957064417db2c45b91fab6547c09ec27092ef32ac87d0ac7300d88266da1de

See more details on using hashes here.

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