Skip to main content

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


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 details)

Uploaded Source

Built Distribution

py_apibase-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file py_apibase-0.1.0.tar.gz.

File metadata

  • Download URL: py_apibase-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for py_apibase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bdba06a44308f0296ef854eb6e4f4d1193457e11f376ebc46836607844ce1ea4
MD5 73584f8aeacc0a1dee994694f45ac6aa
BLAKE2b-256 527c4c126a9b8bdd84a2b2f0fc94bf9eb2e329b2eed0c7f9b13c35f65e482b0f

See more details on using hashes here.

File details

Details for the file py_apibase-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: py_apibase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for py_apibase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4a0664b586c088d629add030ca397e7ccf01c11a2cceada8d3ed3818c47982
MD5 89f2d4a83eb60399bd3cbcef492c615c
BLAKE2b-256 58aa496a50a798db5a593200f83de453b08b68edee7394ff79ba80f67f8a4eab

See more details on using hashes here.

Supported by

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