Skip to main content

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


Download files

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

Source Distribution

elric_core-0.1.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

elric_core-0.1.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

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

Hashes for elric_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6b93164b26b130bd006bb8300b172fca4888f43d91f5868215f24f73d79fc7e
MD5 f805d210325c88e99c6ed0561d9a3c67
BLAKE2b-256 66676295d88aa84ff8c8b85ecf110b749f18e0c9e36d7088ffa6f4d024ff6898

See more details on using hashes here.

Provenance

The following attestation bundles were made for elric_core-0.1.0.tar.gz:

Publisher: publish.yml on marcoinsabato/elric-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for elric_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51d0baf064cb824c14d8c0687c421463595f39e462a7a821742c46ef70a43784
MD5 5700d69e64a051eb3266faa2b05d73b3
BLAKE2b-256 c6d4168213c8a21914ae2ae530a0f59975c1c608bee96dc23e023dc5d675fc72

See more details on using hashes here.

Provenance

The following attestation bundles were made for elric_core-0.1.0-py3-none-any.whl:

Publisher: publish.yml on marcoinsabato/elric-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page