Skip to main content

ai4i-core

Consolidated utility libraries for AI4I microservices — a single installable package providing the cross-cutting concerns (FastAPI bootstrap helpers, logging, observability, telemetry, exceptions, and email) shared across the AI4I backend services.

Installation

pip install ai4i-core

Subpackages

Subpackage Purpose
ai4i_core.bootstrap FastAPI app-factory helpers: cache, database, Redis, health router, rate limiting, schemas, API versioning
ai4i_core.context Shared contextvars (trace id, tenant id, user id, endpoint path) read by the logging and telemetry layers
ai4i_core.email Provider-agnostic transactional email client (SMTP, console; pluggable providers)
ai4i_core.exceptions Shared exception hierarchy, response envelope, and FastAPI exception handlers
ai4i_core.logging Structured JSON logging with trace/tenant correlation and request middleware
ai4i_core.observability Prometheus metrics collection and ASGI middleware
ai4i_core.telemetry OpenTelemetry tracing, W3C context propagation, OpenSearch query clients

Usage

from ai4i_core.bootstrap import create_service_app, init_database, init_redis
from ai4i_core.logging import get_logger, RequestMiddleware
from ai4i_core.exceptions import AppError, InsufficientPermissionsError
from ai4i_core.observability import setup_observability, ObservabilityMiddleware
from ai4i_core.telemetry import TraceManager, trace_stage
from ai4i_core.email import EmailClient, EmailMessage
from ai4i_core.context import get_trace_id, get_tenant_id

Each subpackage's __init__.py (__all__) lists its full public surface.

Requirements

  • Python >= 3.11

License

MIT — see LICENSE.

Metadata

Release files for ai4i-core 1.0.53

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

Source distribution (sdist)

Source distribution for ai4i-core 1.0.53
File Size Uploaded Provenance Actions
ai4i_core-1.0.53.tar.gz 114.5 kB Without provenance Details for ai4i_core-1.0.53.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai4i-core 1.0.53
File Interpreter ABI Platform Actions
ai4i_core-1.0.53-py3-none-any.whl Python 3 none any Details for ai4i_core-1.0.53-py3-none-any.whl

Total release size: 236.3 kB

Release files / ai4i_core-1.0.53.tar.gz

Download URL ai4i_core-1.0.53.tar.gz
Size 114.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8f9e6883a914c7fa99a5375f02db8caf2d53d10731d57c88d0d7cfff466d3fd1
BLAKE2b-256 checksum
How to use checksums
6a87f4342bd9ef7923570fd6a04fc65875738b498c23a6ab069b3aeb0949b17c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / ai4i_core-1.0.53-py3-none-any.whl

Download URL ai4i_core-1.0.53-py3-none-any.whl
Size 121.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08ab874c394b7485de2774ae09f1c39fe3bbe89708a77eebb5957dcc07587943
BLAKE2b-256 checksum
How to use checksums
61e9ed7605d0444cd2c2328fe60d72521cbab615fe6e4acc3e58a6747e9c931c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for ai4i-core 1.0.53

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.0.53 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