Skip to main content

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.

Release files for py-apibase 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-apibase 0.1.0
File Size Uploaded
py_apibase-0.1.0.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-apibase 0.1.0
File Interpreter ABI Platform
py_apibase-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.4 kB

Release files / py_apibase-0.1.0.tar.gz

Download URL py_apibase-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bdba06a44308f0296ef854eb6e4f4d1193457e11f376ebc46836607844ce1ea4
BLAKE2b-256 checksum
How to use checksums
527c4c126a9b8bdd84a2b2f0fc94bf9eb2e329b2eed0c7f9b13c35f65e482b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Release files / py_apibase-0.1.0-py3-none-any.whl

Download URL py_apibase-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4a0664b586c088d629add030ca397e7ccf01c11a2cceada8d3ed3818c47982
BLAKE2b-256 checksum
How to use checksums
58aa496a50a798db5a593200f83de453b08b68edee7394ff79ba80f67f8a4eab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page