Runtime core for the Elric framework: settings, providers, middleware, routing and AI base classes
Project description
elric-core
Runtime core of the Elric framework.
elric-core is a runtime dependency of every generated Elric project. It holds
the code the framework owns and keeps upgrading for you: settings, providers,
middleware, route discovery, error handling, and the AI component base classes.
Code that elric new copies into your project belongs to you and is never
touched by an upgrade. Anything the framework must be able to change later lives
here instead.
Installation
You normally get it via the project scaffold:
uv tool install elric-cli
elric new my_app
Standalone:
uv add elric-core
Usage
# config/settings.py
from functools import lru_cache
from elric_core import ElricSettings
class Settings(ElricSettings):
"""Project settings. Add your own fields here."""
@lru_cache
def get_settings() -> Settings:
return Settings()
# app/__init__.py
from pathlib import Path
from elric_core import create_application
from config.settings import get_settings
ROUTES_DIR = Path(__file__).resolve().parent / "routes"
def create_app():
return create_application(get_settings(), routes_dir=ROUTES_DIR)
create_application wires the lifespan (database, Redis, LangSmith), the
middleware stack, the global exception handler, and auto-discovers every module
under routes_dir that exposes a module-level router.
What's inside
| Module | Contents |
|---|---|
elric_core.config |
ElricSettings base class + settings registry |
elric_core.logging |
structlog setup, trace-id context |
elric_core.providers |
async SQLAlchemy engine, Redis, LangSmith |
elric_core.middleware |
API key auth, sliding-window rate limit, request logging |
elric_core.routing |
filesystem route auto-discovery |
elric_core.exceptions |
exception hierarchy + uniform JSON error handler |
elric_core.security |
API key generation, hashing, verification |
elric_core.models |
framework SQLModel tables (ApiKey) |
elric_core.ai |
BaseAgent, BaseChain, BaseTool |
Schema ownership
elric-core never creates tables. Alembic owns the schema — run elric migrate.
init_db() only verifies connectivity at startup.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elric_core-0.1.0.tar.gz.
File metadata
- Download URL: elric_core-0.1.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6b93164b26b130bd006bb8300b172fca4888f43d91f5868215f24f73d79fc7e
|
|
| MD5 |
f805d210325c88e99c6ed0561d9a3c67
|
|
| BLAKE2b-256 |
66676295d88aa84ff8c8b85ecf110b749f18e0c9e36d7088ffa6f4d024ff6898
|
Provenance
The following attestation bundles were made for elric_core-0.1.0.tar.gz:
Publisher:
publish.yml on marcoinsabato/elric-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elric_core-0.1.0.tar.gz -
Subject digest:
c6b93164b26b130bd006bb8300b172fca4888f43d91f5868215f24f73d79fc7e - Sigstore transparency entry: 2280300526
- Sigstore integration time:
-
Permalink:
marcoinsabato/elric-framework@f8e4a739de06b46d69301736ef8cf3e2eff4e627 -
Branch / Tag:
refs/tags/core-v0.1.0 - Owner: https://github.com/marcoinsabato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8e4a739de06b46d69301736ef8cf3e2eff4e627 -
Trigger Event:
push
-
Statement type:
File details
Details for the file elric_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: elric_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51d0baf064cb824c14d8c0687c421463595f39e462a7a821742c46ef70a43784
|
|
| MD5 |
5700d69e64a051eb3266faa2b05d73b3
|
|
| BLAKE2b-256 |
c6d4168213c8a21914ae2ae530a0f59975c1c608bee96dc23e023dc5d675fc72
|
Provenance
The following attestation bundles were made for elric_core-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on marcoinsabato/elric-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elric_core-0.1.0-py3-none-any.whl -
Subject digest:
51d0baf064cb824c14d8c0687c421463595f39e462a7a821742c46ef70a43784 - Sigstore transparency entry: 2280300573
- Sigstore integration time:
-
Permalink:
marcoinsabato/elric-framework@f8e4a739de06b46d69301736ef8cf3e2eff4e627 -
Branch / Tag:
refs/tags/core-v0.1.0 - Owner: https://github.com/marcoinsabato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8e4a739de06b46d69301736ef8cf3e2eff4e627 -
Trigger Event:
push
-
Statement type: