is a lightweight Python library that simplifies the creation of API clients
Project description
apibase
apibase
is a lightweight Python library that simplifies the creation of API clients. It uses the popular requests
library for handling HTTP requests and abstracts away much of the complexity, allowing you to focus on interacting with the API.
Features
- Simple and intuitive interface
- Supports basic authentication and token-based authentication
- Automatically handles URL construction
- Uses Python's
requests
library for HTTP requests
Requirements
- Python 3.x
requests
library
Installation
You can install apibase
using pip:
pip install apibase
Usage
Here's a basic example of how to use apibase to create an API client:
from apibase import ApiBase
BASE_URL = 'https://api-base.cloud'
class APITest(ApiBase):
pass
fc = APITest(username="user", password="pass", key="key", token="token")
# https://api-base.cloud/orders
orders = fc.orders.get()
for order in orders:
print(f"uid: {order.get('uid')} description: {order.get('description')}")
License
This project is licensed under the MIT License. See the LICENSE file for details. Contributing
Contributions are welcome! Please open an issue or submit a pull request.
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
py_apibase-0.1.0.tar.gz
(14.5 kB
view hashes)
Built Distribution
py_apibase-0.1.0-py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for py_apibase-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4a0664b586c088d629add030ca397e7ccf01c11a2cceada8d3ed3818c47982 |
|
MD5 | 89f2d4a83eb60399bd3cbcef492c615c |
|
BLAKE2b-256 | 58aa496a50a798db5a593200f83de453b08b68edee7394ff79ba80f67f8a4eab |