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

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.47
File Size Uploaded
ai4i_core-1.0.47.tar.gz 112.5 kB Details

Built distribution (wheel)

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

Total release size: 233.6 kB

Release files / ai4i_core-1.0.47.tar.gz

Download URL ai4i_core-1.0.47.tar.gz
Size 112.5 kB
Tags Source
SHA-256 checksum
How to use checksums
520470f3b4aaa6ab65dfa42e23a95cdf8aaa6a008db0e8fc1e40704a6bcfc223
BLAKE2b-256 checksum
How to use checksums
1401bfb221fc375d6c38b4ee27f3ac5851f925db1ffd53f09b1a5a576f37ea87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

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

Download URL ai4i_core-1.0.47-py3-none-any.whl
Size 121.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d62746be8047a33a23719405e01876f3aa0d63285072e75dcf6490288af31dc
BLAKE2b-256 checksum
How to use checksums
d2bbcda7711a35e8772c322829373e00da203e2647eb6257336f3efe4aef4ed6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

1.0.52

2 release files

1.0.51

2 release files

1.0.50

2 release files

1.0.49

2 release files

This release

1.0.47 This release

2 release files

1.0.41

2 release files

1.0.40

2 release files

1.0.39

2 release files

1.0.38

2 release files

1.0.37

2 release files

1.0.36

2 release files

1.0.35

2 release files

1.0.34

2 release files

1.0.33

2 release files

1.0.32

2 release files

1.0.31

2 release files

1.0.30

2 release files

1.0.29

2 release files

1.0.28

2 release files

1.0.27

2 release files

1.0.26

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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