Metadata-Version: 2.4
Name: lexigram
Version: 0.1.1
Summary: Async-first DI/IoC framework for Python — core package
Project-URL: Homepage, https://github.com/lexigram-dev/lexigram
Project-URL: Repository, https://github.com/lexigram-dev/lexigram
Project-URL: Documentation, https://docs.lexigram.dev
Project-URL: Issues, https://github.com/lexigram-dev/lexigram/issues
Project-URL: Changelog, https://github.com/lexigram-dev/lexigram/blob/main/CHANGELOG.md
Author-email: Lexigram Framework Team <team@lexigram.dev>
Maintainer-email: Lexigram Framework Team <team@lexigram.dev>
License: MIT
License-File: LICENSE
Keywords: async,dependency-injection,framework,ioc,provider-pattern
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: lexigram-contracts>=0.1.0
Requires-Dist: orjson>=3.0.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: structlog>=25.1.0
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: ruff>=0.11.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0.0; extra == 'docs'
Requires-Dist: mkdocs>=1.4.0; extra == 'docs'
Provides-Extra: features
Requires-Dist: lexigram-features>=0.1.1; extra == 'features'
Provides-Extra: resilience
Requires-Dist: lexigram-resilience>=0.1.1; extra == 'resilience'
Provides-Extra: search
Requires-Dist: lexigram-search>=0.1.1; extra == 'search'
Provides-Extra: security
Requires-Dist: cryptography>=41.0.0; extra == 'security'
Requires-Dist: nh3>=0.3.4; extra == 'security'
Provides-Extra: tasks
Requires-Dist: lexigram-tasks>=0.1.1; extra == 'tasks'
Provides-Extra: test
Requires-Dist: lexigram-monitor>=0.1.1; extra == 'test'
Requires-Dist: lexigram-testing>=0.1.1; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
Requires-Dist: pytest-mock>=3.10.0; extra == 'test'
Requires-Dist: pytest>=8.0.0; extra == 'test'
Description-Content-Type: text/markdown

# lexigram

Async-first DI/IoC framework for Python — core package.

---

## Overview

Lexigram is the foundation package for the wider Lexigram ecosystem. It provides the
DI/IoC container, application lifecycle, configuration system, provider protocol,
exception hierarchy, and structured logging foundation.

Async-first by design: application boot, provider lifecycle, I/O paths, and
resolution workflows are built for async Python. Use `Application.boot(...)` to
assemble modules and providers into a running app.

## Install

```bash
uv add lexigram
# Optional extras
uv add "lexigram[security]"
```

## Quick Start

```python
from lexigram import Application
from lexigram.di.module import Module, module
from lexigram.app.standard import StandardModule

@module(imports=[StandardModule.configure()])
class AppModule(Module):
    pass

app = Application(modules=[AppModule])
if __name__ == "__main__":
    app.run()
```

## Configuration

> **Zero-config usage:** Call `StandardModule.configure()` with no arguments to use defaults.

### Option 1 — YAML file

```yaml
# application.yaml
lexigram:
  # config fields here
```

### Option 2 — Profiles + Environment Variables *(recommended)*

```bash
export LEX_PROFILE=production
# Environment variables for each field
```

### Option 3 — Python

```python
from lexigram.config.main import LexigramConfig

config = LexigramConfig(...)
StandardModule.configure(config_class=LexigramConfig)
```

## Module Factory Methods

| Method | Description |
|--------|-------------|
| `StandardModule.configure(...)` | Configure with explicit config, sources, or overrides |
| `StandardModule.stub()` | Minimal config for testing |
| `CoreModule.configure(...)` | Stripped-down kernel without serialization or concurrency |

## Key Features

- **DI Container** — register services as singleton, transient, or scoped; resolve via `await container.resolve(ServiceType)`
- **Provider Lifecycle** — `register()`, `boot()`, `shutdown()` hooks with priority ordering
- **Result Pattern** — `Result[T, E]` for expected domain failures, exceptions for infrastructure errors
- **Module System** — compose applications from reusable modules with explicit exports
- **Structured Logging** — structlog-based logging via `get_logger(__name__)`
- **Configuration** — Pydantic-based config with YAML, environment variables, and profile support

## Testing

```python
async with Application.boot(modules=[StandardModule.stub()]) as app:
    # your test code
    ...
```

## Key Source Files

| File | What it contains |
|------|-----------------|
| `src/lexigram/app/base.py` | Application lifecycle and boot flow |
| `src/lexigram/app/standard.py` | StandardModule.configure() with all kernel providers |
| `src/lexigram/di/container/container.py` | Container registration, scope, and diagnostics |
| `src/lexigram/result/` | Result, Ok, Err, and helpers |
| `src/lexigram/config/main.py` | LexigramConfig and configuration system |
