HexCore is published on PyPI asDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Indroic/HexCore/llms.txt
Use this file to discover all available pages before exploring further.
hexcore and requires Python 3.12 or later. The core package ships with Pydantic v2, Typer, and croniter — everything needed to define entities, run the CQRS buses in memory, and use the CLI. All database drivers, API frameworks, and message-queue clients are optional extras so that your production image only carries what it actually needs.
Core install
BaseEntity,DomainEvent, and all domain primitivesCommand,Query,AbstractCommandHandler,AbstractQueryHandlerHandlerRegistry,InMemoryCommandBus,InMemoryQueryBus,InMemoryEventBusIBaseRepository,IUnitOfWork,BaseDomainService- The
hexcoreCLI for project scaffolding
Optional extras
Install only the integrations relevant to your stack. Mix and match by combining extras with a comma-separated list, for examplehexcore[api,sql,redis].
hexcore[api] — FastAPI
hexcore[redis] — Redis
RedisEventBus for cross-process pub/sub, the RedisLockProvider for distributed cron-job locking, and the Redis cache backend.
hexcore[mongo] — MongoDB
BeanieODMCommonImplementationsRepo for MongoDB-backed repositories and init_beanie_documents() for auto-document discovery.
hexcore[sql] — SQLAlchemy / PostgreSQL / SQLite
BaseSQLAlchemyRepository, async session management, and Alembic migrations.
hexcore[rabbitmq] — RabbitMQ
hexcore[procrastinate] — Procrastinate task queue
PostgresLockProvider for distributed scheduling.
hexcore[celery] — Celery task queue
CeleryEnqueuer adapter and register_hexcore_celery_tasks() helper for auto-registering CQRS tasks on the Celery worker.
hexcore[all] — Everything
Installing multiple extras
Python version requirements
| Python | Supported |
|---|---|
| 3.12 | ✅ |
| 3.13 | ✅ |
| < 3.12 | ❌ |
Environment variable configuration
HexCore’sLazyConfig resolves which config.py module to load at startup. Override the defaults using environment variables so that different environments (dev, staging, production) can each point to a different configuration module.
LazyConfig is:
HEXCORE_CONFIG_MODULEenvironment variableHEXCORE_CONFIG_MODULESenvironment variable (comma-separated list)- Modules registered via
LazyConfig.set_config_modules(...) - Default
configmodule at the project root
config.py looks like this:
Since v2, if
repository_discovery_paths is empty the Unit of Work raises an explicit error rather than silently discovering no repositories. This prevents hard-to-debug runtime failures in production.