Skip to main content

Command line interface for HTTP requests defined in yaml configuration file

Project description

ADZ

Command line interface for HTTP requests defined in yaml configuration file.

Install

pip install adz

Quick start

Having a yaml configuration file

endpoints:
  endpoint:
    request: GET https://httpbin.org/get
    headers:
      Content-Type: application/json

and running on command line

adz endpoint

will execute endpoint request defined in configuration file and print

GET https://httpbin.org/get
HTTP/1.1 200 OK
 • access-control-allow-credentials: true
 • access-control-allow-origin: *
 • content-encoding: gzip
 • content-type: application/json
 • date: Thu, 06 Jun 2019 06:06:06 GMT
 • referrer-policy: no-referrer-when-downgrade
 • server: nginx
 • x-content-type-options: nosniff
 • x-frame-options: DENY
 • x-xss-protection: 1; mode=block
 • content-length: 204
 • connection: keep-alive

{
    "args": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate",
        "Content-Type": "application/json",
        "Host": "httpbin.org",
        "User-Agent": "python-httpx/0.7.1"
    },
    "url": "https://httpbin.org/get"
}

Configuration

For an example configuration look at docs/example.yml.

settings

  • colors: bool, default: true
    • control output print in colors
  • response: bool, default: true
    • control response body output
  • theme: str, default native
    • any theme name from here should work

variables

  • used to interpolate values in headers and urls
    • variable: abc applied on url: http://example.org/$variable results in http://example.org/abc
  • variable value starting with file:// is opened as file and loaded as string into variable

endpoints

  • description
  • method
    • http methods
  • url
  • request
    • method url e.g. get http://example.org
  • params
    • query string parameters
  • headers
  • json
    • json string
    • string starting with file:// is loaded as json file
  • data
    • json string
    • string starting with file:// is loaded as json file
  • cookies
  • files
    • path to a file: path/to/file.txt
    • file name and path: filename: path/to/file.txt

Configuration file

Expected configuration file names
  • adz.yaml or adz.yml
  • api.yaml or api.yml
  • rest.yaml or rest.yml
Expected locations
  • current location: .
  • user's home: ~/
  • .adz directory in user's home e.g. ~/.adz/

Configuration file path can also be set using environmental variable ADZ.

CLI

Run adz -h

commands

  • adz --config, adz -c

    • path to yaml configuration file
  • adz --details <endpoint>, adz -d <endpoint>

    • output details about endpoint from configuration file
  • adz --list, adz -l

    • list available endpoints in configuration file
  • adz --output, adz -o

    • output processed configuration file as json
  • adz --settings, adz -s

    • output settings in configuration file
  • adz --var name=value, adz -v name=value

    • set or override variables in configuration
  • adz --colors, adz --no-colors

    • control output print in colors
  • adz --response, adz --no-response

    • control response body output

License

ADZ is licensed under a three clause BSD License. Full license text can be found here.

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

adz-0.6.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

adz-0.6.0-py2.py3-none-any.whl (10.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file adz-0.6.0.tar.gz.

File metadata

  • Download URL: adz-0.6.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for adz-0.6.0.tar.gz
Algorithm Hash digest
SHA256 593cdea451b28d897c1bfc7334b640c342366d567e3d16c180ec5e3d125d810a
MD5 1b18f3b786319fec2032d78c66660c79
BLAKE2b-256 60341ecfe17bcef740d62d6e0de6b5a7a75ad1c8eebfd89880f0f0831a3f6ed2

See more details on using hashes here.

File details

Details for the file adz-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: adz-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for adz-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd4533866b5244c85c17bfd97d9d13483e7b513c1b279fe50e0b9d5377e8558f
MD5 f2f41022ed8d2825fa6fb7fdcee457e8
BLAKE2b-256 0a23c968d5133e5bcdb0642138b32a72ba2234284c30fb8daa2ad3e3b5937b02

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