Skip to main content

An API Client for the terminal. A Python CLI for API testing and development.

Project description

Lint and Test

🌐 Zapman

An API Client for the terminal. A Python CLI for API testing and development.

usage: zap [-h] {run,curl,cookies,vars,version} ...

An API Client for the terminal. A Python CLI for API testing and development.

options:
  -h, --help            show this help message and exit

commands:
  {run,curl,cookies,vars,version}
    run                 🚀 run a Zapfile
    curl                🌊 print the curl command for a Zapfile
    cookies             🍪 view stored cookies
    vars                📋 view stored variables
    version             🔖 show version

✨ Features

  • 🛠️ Environments & variables
  • 🔄 Scriptable & easily shareable via git
  • 🖥️ A simple and small CLI
  • 🌈 Colored output
  • 🐍 Pure python

🚀 Using

To install this package, run:

pip install zapman

Create a Zapfile called get.py (Zapfiles are just regular python files):

GET = "https://httpbin.org/get"

PARAMS = {
    "foo": "bar"
}

Run with:

zap run get.py

Output:

GET /get?foo=bar HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: httpbin.org
User-Agent: Zapman/0.0.0



HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 325
Content-Type: application/json
Date: Thu, 19 Dec 2024 23:26:56 GMT
Server: gunicorn/19.9.0

{
    "args": {
        "foo": "bar"
    },
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate",
        "Host": "httpbin.org",
        "User-Agent": "Zapman/0.0.0",
        "X-Amzn-Trace-Id": "Root=1-6764abbf-60e6ac856a6fe7c32c0e2f3b"
    },
    "origin": "0.0.0.0",
    "url": "https://httpbin.org/get?foo=bar"
}


Elapsed time: 1.10440575s

More example Zapfiles in zaps.

🧑‍💻 Contributing

Prerequisites
1. Install Docker
  1. Go to Docker, download and install docker.
  2. Configure Docker to use the BuildKit build system. On macOS and Windows, BuildKit is enabled by default in Docker Desktop.
2. Install VS Code

Go to VS Code, download and install VS Code.

1. Open DevContainer with VS Code

Open this repository with VS Code, and run Ctrl/⌘ + + PDev Containers: Reopen in Container.

The following commands can be used inside a DevContainer.

2. Run linters

poe lint

3. Run tests

poe test

4. Update poetry lock file

poetry lock --no-update

See how to develop with PyCharm or any other IDE.


️⚡️ Scaffolded with Poetry Copier.
🛠️ Open an issue if you have any questions or suggestions.

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

zapman-0.0.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zapman-0.0.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file zapman-0.0.2.tar.gz.

File metadata

  • Download URL: zapman-0.0.2.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for zapman-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5db0477e1ea2d4cb0f04cba81dbac6b69c9b0d2e14a188b7d5673db2508f5a67
MD5 ae595f528264056f002fb2605df53be4
BLAKE2b-256 77581d448cd69891a4db0e2972eb0a915223873365e2bac315e71d3ad6b60b58

See more details on using hashes here.

File details

Details for the file zapman-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: zapman-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for zapman-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9eff4e055bd9458d553cc329f5b201534f485e655531b3c6ad319ff3897ffd0
MD5 7fc3cbf52fec26848b2527c3b4b68f3f
BLAKE2b-256 7988031253174bee039737688cedcbed68fed45163c186a9bb4ec3bb880632b3

See more details on using hashes here.

Supported by

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