Explore APIs from your console with API Buddy
Project description
API Buddy
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
- It should be one of:
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 ofkey=val
query paramsdata
: (optional) A JSON string of requets body data.- You can't use this with
get
because HTTP.
- You can't use this with
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for api_buddy-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf2dfe3b960e6d0493062b6095892479d8e3bbec264baf6ca92128f1d7d03544 |
|
MD5 | 75f7cee2ddc3be217ed9edc479960c41 |
|
BLAKE2b-256 | 80d366cd73bda7221f5a4117b4229fa1778fa67183ef17c3c28c678237b3272a |