Skip to main content

Explore APIs from your console with API Buddy

Project description

API Buddy

Build Status PyPI version

Demo

Right now, only OAuth2 authentication is supported. It's the most common, and current gold standard for security best practices. Also most APIs use it. That said, I have no beef with all the APIs out there using something else, so feel free to open a ticket if you want something else supported. 🎟

You can also always manually set headers.

Installation

As long as you have python 3.7 or higher (I recommend using pyenv), just:

pip install api-buddy

Usage

First, specify the API you're exploring in your preferences

# ~/.api-buddy.yaml
api_url: https://some.api.com

Then it's as easy as:

api get some-endpoint
=> 200
{
  "look": "I haz data",
  "thx": "API Buddy"
}

HTTP Method defaults to get:

api this-endpoint  # same as first example

You can add query params in key=val format:

api get \
  my/favorite/endpoint \
  first_name=cosmo \
  last_name=kramer

You can also add request body data in JSON format:

api post \
  some-endpoint \
  '{"id": 1, "field": "value"}'

🤔 Note the single-quotes. You can expand this accross multiple lines:

api post \
  some-endpoint \
  '{
     "id": 1,
     "field": "value"
  }'

Preferences 👉

Arguments

  • http_method: (optional, default=get) The HTTP method to use in your request.
    • It should be one of:
      • get
      • post
      • patch
      • put
      • delete
  • endpoint: (required) The relative path to an API endpoint.
    • AKA you don't need to type the base api url again here.
  • params: (optional) A list of key=val query params
  • data: (optional) A JSON string of requets body data.
    • You can't use this with get because HTTP.

Options

  • -h, --help: Show the help message
  • -v, --version: Show the installed version

Development

Requires:

Steps to start working:

  • Build and create the local venv with bin/setup
  • Make sure everything works with bin/test
  • Try the local cli with poetry run api --help
  • Find other management commands with bin/list

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

api-buddy-0.2.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

api_buddy-0.2.2-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file api-buddy-0.2.2.tar.gz.

File metadata

  • Download URL: api-buddy-0.2.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Darwin/18.2.0

File hashes

Hashes for api-buddy-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4e821dbb44c621b462474bd6bba90bda4cb1b52207252e3ce698ccd47624d4f8
MD5 4753c7ba5faf5442b884d5fb2b5455d6
BLAKE2b-256 f13204859a6f573247b36b926ea6066433173029e0ce080ad5a632ca6b9b5f90

See more details on using hashes here.

File details

Details for the file api_buddy-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: api_buddy-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Darwin/18.2.0

File hashes

Hashes for api_buddy-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d17734b12dfb87fd8aabfecf0c40a03604091ea3ec5b1df23f0b66ae14cc6a7
MD5 b0e197251ae6aefbfe227dc6aad09e4b
BLAKE2b-256 a28f04b88ca64854f914fc10532965c3909a4f610e159aef5a812d78f655bdde

See more details on using hashes here.

Supported by

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