Skip to main content

Hermes cURL is a lightweight wrapper on top of cURL that provides reusable HTTP request configurations in YAML.

Project description

Hermes cURL

Hermes cURL is a lightweight wrapper on top of cURL that provides reusable HTTP request configurations in YAML. Configuration files can import attributes from other files which allows for common settings such as hostnames and authentication headers to be shared by multiple cURL calls.

Usage

Base configuration for an entire API:

# api_base.yml
headers:
  Authorization: Token MySecretAPIToken
  Content-Type: application/json
host: localhost:5000
curl_flags:
   "--location":

Configuration for a specific endpoint:

# api.yml
from: api_base.yml
method: PUT
path: /my/api
body: >
  {"hello": "world"}

Run the hermes command:

$ hermes api.yml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   128  100   112  100    16   3960    565 --:--:-- --:--:-- --:--:--  4000
{
   "msg": "hello Mr world"
}

Configuration file reference

  • from (optional): specify a path to another configuration file to inherit configurations from. This path is relative to the current file.
  • path (requires): path on the server to send the request to, including any query params.
  • method (required): HTTP method to use.
  • host (required): server host, including protocol and port.
  • headers (optional): dictionary of headers in the form. ExHeader: value.
  • body (optional): request body.
  • curl_flags (optional): a dictionary with any other curl flags to add. Ex "--cacert: certfile".

Installation

python3 -m pip install hermes-curl

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

hermes_curl-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

hermes_curl-1.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file hermes_curl-1.0.1.tar.gz.

File metadata

  • Download URL: hermes_curl-1.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for hermes_curl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a317ce99a8b5867366efc74d77997532cfa10a48adf15f156eda301a27fed948
MD5 52bb63cc99d52c7e72fbaef250d0a448
BLAKE2b-256 7661387f8b2a5c4bad6d84d76b70829799d2772c0d59d04aafccb13fe7d0d0d6

See more details on using hashes here.

File details

Details for the file hermes_curl-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: hermes_curl-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for hermes_curl-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce026885cad2e31c05757513ccacf90f543a8dc01e7720efd944b61412f44e25
MD5 4c5123b57b9a83dee3b288573d917aba
BLAKE2b-256 ac2a493e8cba9ffe09d843c5949fb5db77e9273467216306b28fb7a8411f504a

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