Skip to main content

base-api-utils

DRF common utilities

Virtual Env

$ python3 -m venv env

$ source env/bin/activate

python setup

sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get -y -f install python3.7 python3-pip python3.7-dev python3.7-venv libpython3.7-dev python3-setuptools
sudo -H pip3 --default-timeout=50 install --upgrade pip
sudo -H pip3 install virtualenv

Install reqs

pip install -r requirements.txt

Development dependencies

To install dev dependencies (e.g. pytest):

pip install -e ".[dev]"

Packaging

Create ~/.pypirc:

[distutils]
index-servers =
    pypi

[pypi]
username = __token__
password = pypi-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
python3 -m pip install --upgrade build
python3 -m build

Uploading

python3 -m pip install --upgrade twine

Test Py Pi

python3 -m twine upload --repository testpypi dist/*

Production PyPi

python3 -m twine upload dist/*

Install from testPyPi.Org

pip install -i https://test.pypi.org/simple/ base-api-utils --no-deps

Install from GitHub

pip install git+https://github.com/fntechgit/base-api-utils

Failed Celery Async Tasks Management

For a deep dive into the technical implementation, CLI usage, and troubleshooting steps, please refer to the dedicated management guide:

Management & Recovery Deep Dive: /docs/celery-management.md

Celery worker defaults

base_api_utils.celery_worker.apply_worker_defaults makes a worker acknowledge a task once it ends, so a task whose worker dies is delivered again, and bounds each task and pool child:

Late acknowledgement, time limits and memory per child: /docs/celery-worker.md

Logging and the OTLP log bridge

base_api_utils.logging_config.build_logging builds a service's settings.LOGGING, and base_api_utils.otel_logging.configure_otel_logging ships its log records over OTLP:

Logging and the OTLP log bridge: /docs/logging.md

A credential a service carries in its URLs under a name of its own, or in a path, is declared once with base_api_utils.url_credentials.declare_url_credentials, and both the logs and the traces redact it: A service's own URL credentials.

Traces

base_api_utils.otel_instrumentation, base_api_utils.tracing and base_api_utils.otel_celery give a service its traces, a root span for jobs and consumers, and the Celery worker hooks:

Traces, root spans and the Celery worker hooks: /docs/tracing.md

Metadata

Release files for base-api-utils 1.1.128

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

Source distribution (sdist)

Source distribution for base-api-utils 1.1.128
File Size Uploaded Provenance Actions
base_api_utils-1.1.128.tar.gz 150.7 kB Without provenance Details for base_api_utils-1.1.128.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for base-api-utils 1.1.128
File Interpreter ABI Platform Actions
base_api_utils-1.1.128-py3-none-any.whl Python 3 none any Details for base_api_utils-1.1.128-py3-none-any.whl

Total release size: 271.2 kB

Release files / base_api_utils-1.1.128.tar.gz

Download URL base_api_utils-1.1.128.tar.gz
Size 150.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a031ec5f7a2e59529b8b43640cc62cc4868eb70e2bb0d6f45863e494184c2bb6
BLAKE2b-256 checksum
How to use checksums
137a3797dd4e0344e7e987a457511ca9e9e8d6b9a01f6374681b8abae60c8760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / base_api_utils-1.1.128-py3-none-any.whl

Download URL base_api_utils-1.1.128-py3-none-any.whl
Size 120.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33c3b3342dbbce04d981ba643adeaf4310f5c16c14469349a1ae768b6ed8b0f4
BLAKE2b-256 checksum
How to use checksums
9c120ba9068cd75e11526d957314ab233dc0b91d23236c684862d59d7f0e12c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for base-api-utils 1.1.128

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.128 This release

2 release files No provenance

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