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

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.54
File Size Uploaded Provenance Actions
ai4i_core-1.0.54.tar.gz 114.5 kB Without provenance Details for ai4i_core-1.0.54.tar.gz

Built distribution (wheel)

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

Total release size: 236.4 kB

Release files / ai4i_core-1.0.54.tar.gz

Download URL ai4i_core-1.0.54.tar.gz
Size 114.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d9048dc23ce449b65163712785a8325cd907e4bd53f1575f75f855e35918b8ff
BLAKE2b-256 checksum
How to use checksums
d83ee06238ea002d086040aaa3d22177fc604536205573b5cd403c90c5995ce9
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.54-py3-none-any.whl

Download URL ai4i_core-1.0.54-py3-none-any.whl
Size 121.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
578feaad8f3e24d872a0f3c3dd0b80e21bc1255064bf1380698ab4f46fcb02b7
BLAKE2b-256 checksum
How to use checksums
fdf07cedbac4c6f5a2737ebd3f41fd8b54247574f6dcd0b3c4f9b815e7871a3c
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.54

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