Installation
Requirements
Section titled “Requirements”- Python 3.11 or higher
- uv (recommended) or pip
Quick Install
Section titled “Quick Install”# uv (recommended — fast, deterministic)uv add lexigram
# pippip install lexigramThe core lexigram package gives you:
| Feature | Import | Description |
|---|---|---|
Application | lexigram.Application | Composition root with lifecycle management |
Provider | lexigram.Provider | Two-phase register / boot service wiring |
Container | lexigram.Container | IoC container — singleton, scoped, transient bindings |
| DI Decorators | lexigram.singleton, lexigram.injectable | @singleton, @injectable, @scoped, @transient |
LexigramConfig | lexigram.LexigramConfig | YAML + env vars + profile overlays |
Result | lexigram.Result, lexigram.Ok, lexigram.Err | Result pattern with unwrap, map, and_then |
Module | lexigram.Module | @module decorator with import/export boundaries |
| Contracts | lexigram_contracts | Base protocols (auto-installed) |
Common Stacks
Section titled “Common Stacks”Install only what you need. Every package depends only on lexigram (core) and lexigram-contracts.
Web API
Section titled “Web API”uv add lexigram-webStarlette-based web layer — controllers, routing, middleware, OpenAPI docs, CORS, CSRF, rate limiting.
Database
Section titled “Database”uv add lexigram-sqlAsync ORM, migrations, repository pattern.
AI Agents
Section titled “AI Agents”uv add lexigram-ai-agentsAgent framework with tools, strategies (ReAct, PlanAndExecute), and governance.
All Packages
Section titled “All Packages”| Category | Packages |
|---|---|
| Core | lexigram, lexigram-contracts |
| Web & API | lexigram-web, lexigram-http, lexigram-graphql |
| Security | lexigram-auth, lexigram-security |
| Data & Storage | lexigram-sql, lexigram-cache, lexigram-storage, lexigram-search |
| Events & Messaging | lexigram-events, lexigram-queue, lexigram-notification |
| AI | lexigram-ai, lexigram-ai-llm, lexigram-ai-rag, lexigram-ai-agents, lexigram-ai-memory |
| Resilience | lexigram-resilience, lexigram-idempotency |
| Observability | lexigram-monitor, lexigram-ai-observability |
| Tasks & Workflow | lexigram-tasks, lexigram-workflow |
| Utilities | lexigram-testing, lexigram-cli, lexigram-features |
Developer Tools
Section titled “Developer Tools”# CLI — project scaffolding, code generation, dev serveruv add lexigram-cli
# Testing — fakes, test containers, compliance suitesuv add --dev lexigram-testingVerify Installation
Section titled “Verify Installation”python -c "import lexigram; print(lexigram.__version__)"Next Steps
Section titled “Next Steps”- Your First App — Build a working API in under 10 lines
- Project Structure — Recommended layouts
- Core Concepts — Providers, DI, Result type, and modules