Reusable API integration utility for Django services
Project description
django-api-utility
Reusable API integration utility for Django services.
Features
- Service + endpoint registry models
- Definition-key based endpoint resolution
- OAuth token fetch/refresh flow with encrypted token storage
- Consistent utility exceptions for config, token, and request errors
- Thin request wrapper with retry support
Install
pip install -e .
Django setup
Add app:
INSTALLED_APPS = [
# ...
"django_api_utility",
]
Definition key mapping
Provide a JSON mapping file via EXTERNAL_DEFINITION_KEYS_FILE, or use the packaged default at config/external_definition_keys.json.
Example:
{
"users_get": "service_users_get"
}
Usage
from django_api_utility import get_by_key, post_by_key
response = get_by_key("users_get", params={"page": 1})
create_response = post_by_key("users_create", payload={"name": "Alice"})
Internal layout
django_api_utility/transport/: HTTP transport and outbound execution primitivesdjango_api_utility/domain/: definition keys, endpoint resolution, token lifecycledjango_api_utility/orchestration/: request orchestration with retries and token refresh fallback
Tests
pip install -e ".[test]"
pytest -q
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
django_api_utility-0.1.0.tar.gz
(14.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_api_utility-0.1.0.tar.gz.
File metadata
- Download URL: django_api_utility-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d6c36126d3bdc941d2a6753e5723e864afff918292457b736c0af8685c7648c
|
|
| MD5 |
f7634c5a80a767a3570114aff5b165c0
|
|
| BLAKE2b-256 |
eec299e7f3d444cc58728283f7f079e574de9f21f198d67b9340426ced1185f6
|
File details
Details for the file django_api_utility-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_api_utility-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c111582bb86684a254bb0fcf410823f863576d830a45645a7b794b1d41e756f8
|
|
| MD5 |
ead72bf4b6c6f9cce4f61fc0539d2c6a
|
|
| BLAKE2b-256 |
e6bf7029305a0bccbb02db1d7c7761df86e121489d151ea37cd5e1b08a9a50fc
|