Skip to content

Package organization

Since ADR-0001, mic-struct is no longer a single package. It is delivered as three independent PyPI distributions sharing the same mic.* namespace (a PEP 420 namespace package with no root __init__.py). Services install only what they need while imports remain import mic.<module>.

Independent versions

mic-core, mic-datastore, and mic-platform evolve independently under the core-vX.Y.Z, datastore-vX.Y.Z, and platform-vX.Y.Z tags. The mic-struct meta-package preserves compatibility for historical installs. Pin each package to a compatible range such as >=0.1,<1 instead of assuming identical version numbers.

The three packages

PyPI package Role mic.* modules
mic-core Cross-cutting foundations: static or governed contracts, organization scope, HTTP, errors, service auth, client, observability, health, resilience, replay, CLI, and gRPC mic.contracts · mic.tenancy · mic.model · mic.http · mic.fastapi · mic.litestar · mic.auth · mic.client · mic.observability · mic.healthcheck · mic.resilience · mic.event_replay · mic.cli · mic.grpc
mic-datastore Persistence and messaging: stores, cache, outbox, idempotency, locks, event buses, read models, realtime, periodic work, response cache, and sharding mic.datastorage · mic.cache · mic.outbox · mic.idempotency · mic.locking · mic.eventbus · mic.queue · mic.read_models · mic.realtime · mic.scheduling · mic.response_cache · mic.shard
mic-platform Platform policy: authorization, identity providers, and rate limiting mic.authz · mic.identity · mic.ratelimit

Shared namespace - import mic.contracts from mic-core and import mic.outbox from mic-datastore coexist because all three distributions install into the same mic/ namespace.

Which package for which need?

Need Package and extra
FastAPI service mic-core[fastapi]
Litestar service mic-core[litestar]
Inter-service JWT auth mic-core[auth]
OIDC / JWKS verification mic-core[oidc]
Governed contracts / organization scope mic-core
Signed outbound HTTP client mic-core[client]
Prometheus + OTel observability mic-core[observability] or [full-observability] with Sentry and tracing
gRPC / CLI mic-core[grpc] · mic-core[cli]
PostgreSQL / MySQL / Oracle mic-datastore[postgres] · [mysql] · [oracle]
MongoDB / Neo4j mic-datastore[mongo] · [neo4j]
Redis cache, locks, event bus, and idempotency mic-datastore[redis]
Distributed periodic work mic-datastore[redis]
Durable NATS / Kafka messaging mic-datastore[messaging] or [nats] / [kafka]
Realtime WebSocket mic-datastore[ws]
Rate limiting mic-platform[redis]
OPA / OpenFGA authorization mic-platform[opa] · mic-platform[openfga]
Keycloak client mic-platform[keycloak]

For example, an API service using PostgreSQL, service authentication, and observability installs:

pip install "mic-core[fastapi,auth,observability]" "mic-datastore[postgres]"

The cookiecutter scaffold generates these dependencies in the service pyproject.toml.