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.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai4i_core-1.0.5.1.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai4i_core-1.0.5.1-py3-none-any.whl (67.5 kB view details)

Uploaded Python 3

File details

Details for the file ai4i_core-1.0.5.1.tar.gz.

File metadata

  • Download URL: ai4i_core-1.0.5.1.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for ai4i_core-1.0.5.1.tar.gz
Algorithm Hash digest
SHA256 b93755513367181332c5fd66650a87ea8ebb303479c5c3798d2c9f97a84878ab
MD5 188cd54098ad8d257d100e360cef4be6
BLAKE2b-256 4f7c5d011ed5d999bf7d6cc4a96e6280d2ca3853fc6d0c57a88d8a05000a15e7

See more details on using hashes here.

File details

Details for the file ai4i_core-1.0.5.1-py3-none-any.whl.

File metadata

  • Download URL: ai4i_core-1.0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 67.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for ai4i_core-1.0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c600e959a4937c88ea9a204c254e7b51bac787a2e34007156e9064d84d4b315
MD5 df452a4e10ac94dd6138d6b760200454
BLAKE2b-256 b583cdfc235d4db1054113e9554c5c46071309f71f6f8857e94ccc344bcac4f3

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.27

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.17

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

This release

1.0.5.1 This release

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 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