MoltPy
MoltPy is an interactive CLI tool that generates production-ready, customizable FastAPI project templates from modular building blocks.
Features
- Interactive Wizard — Step-by-step CLI prompts with sensible defaults and live dependency visualization
- Modular Architecture — 36 modules; enable only what you need
- Declarative Configuration — Generate and reuse
moltpy.yamlor JSON configuration files - UV Integration — Modern, fast Python package management
- Docker Ready — Multi-stage Dockerfile and Docker Compose setup
- Authentication — JWT and OAuth2 password flow out of the box
- Database — SQLAlchemy 2.0 with Alembic migrations
- Background Jobs — Celery or ARQ with Redis broker
- Testing — pytest with async support and coverage
- Logging — Structured JSON logging with structlog
- CI/CD — GitHub Actions workflows included
- Documentation — MkDocs with Material theme
- Resource Scaffolder — Generate CRUD layers (model, schema, router, service, tests) with
moltpy generate resource - Dry Run — Preview projects before generating with
--dry-run - Safe Defaults — Overwrite protection with
--forceopt-in - Syntax Validation — Generated Python is validated with
py_compilebefore delivery - Email Templates — Responsive HTML and plain-text templates for welcome, password reset, and receipts
- Grafana Dashboards — Pre-configured observability dashboard when
observabilityanddockerare selected - Frontend SDK Generation — Auto-generate typed TypeScript clients from your OpenAPI specification
- Terraform IaC — Production-ready AWS/GCP infrastructure configurations
- Auto-Generated Docs —
docs/modules.mdandCONTRIBUTING.mdgenerated for every project - External Modules — Load modules from GitHub repositories (
github:user/repo#module-name) or~/.config/moltpy/modules/ - Custom Template Overrides — Override built-in templates with
--template-dirfor corporate branding or internal conventions
Installation
# Install with UV (recommended)
uv tool install moltpy
# Or with pip
pip install moltpy
Demo
$ moltpy new --preset standard --name my-api
✅ Project my-api created at ./my-api
10 modules included
Next steps:
cd my-api
uv sync
make run-dev
Quick Start
Interactive Mode
moltpy new
Follow the prompts to configure your project.
Preset Mode
# Use a built-in preset
moltpy new --preset standard --name my-api
# Available presets: minimal, standard, full-stack, microservice
Custom Modules
moltpy new --name my-api --modules auth,database,docker,testing
# With a GitHub module
moltpy new --name my-api --modules auth,github:user/repo#my-module --no-interactive
# With custom template overrides
moltpy new --name my-api --preset standard --template-dir ./my-templates --no-interactive
Resource Scaffolding (Day-2)
After creating a project, scaffold new CRUD resources without writing boilerplate:
cd my-api
# Generate a complete CRUD resource
moltpy generate resource Post title:str content:text is_published:bool
# Preview without writing
moltpy generate resource Post title:str --dry-run
# Skip the Alembic migration
moltpy generate resource Post title:str --skip-alembic
Declarative Configuration
# Generate a starter config file
moltpy init-config --preset standard --output moltpy.yaml
# Edit moltpy.yaml, then generate from it
moltpy new --config-file moltpy.yaml --no-interactive
# Or use JSON
moltpy new --config-file moltpy.json --no-interactive
Available Modules
| Module | Description | Category |
|---|---|---|
| admin | Database admin panel with SQLAdmin | core |
| api_versioning | URL path versioning with /v1/, /v2/ prefix support | api |
| arq | ARQ lightweight async job queue with Redis | background_jobs |
| auth | JWT + OAuth2 password flow authentication with bcrypt hashing | security |
| auth_social | Google and GitHub OAuth2 login with JWT integration | security |
| celery | Celery background job processor with Redis broker | background_jobs |
| cors | CORS middleware configuration with environment-based origins | api |
| database | SQLAlchemy 2.0 async setup with Alembic migrations | core |
| docker | Multi-stage Dockerfile and Docker Compose setup | deployment |
| docs | MkDocs documentation structure with Material theme | documentation |
| Async email sending via SMTP or SendGrid | core | |
| events | In-memory async event bus for decoupled domain events | core |
| github_actions | GitHub Actions CI/CD workflows | deployment |
| graphql | GraphQL API with Strawberry | api |
| grpc | gRPC services for high-performance inter-service communication | api |
| health | Health check endpoints for /health, /health/live, /health/ready | api |
| kubernetes | Raw Kubernetes YAML manifests | deployment |
| logging | Structured JSON logging with structlog and request ID middleware | infrastructure |
| makefile | Common development commands (lint, test, format, migrate, run-dev) | development |
| notifications | Push notifications with Firebase Cloud Messaging | infrastructure |
| observability | OpenTelemetry middleware and Prometheus /metrics endpoint | infrastructure |
| openapi | Custom OpenAPI schema customization and documentation | api |
| pagination | Generic pagination utilities with cursor and offset support | api |
| payments | Payment processing with Stripe (checkout, webhooks, customer portal) | infrastructure |
| pre_commit | Pre-commit hooks for ruff linting and formatting | development |
| rate_limit | SlowAPI rate limiting with Redis-backed sliding window | security |
| redis | Redis connection pool and dependency injection | infrastructure |
| scheduler | Background scheduled jobs with APScheduler | core |
| search | Full-text search with Meilisearch | infrastructure |
| seeding | Database seeding with Faker | development |
| sentry | Sentry error tracking integration with release tagging | infrastructure |
| storage | S3 / Cloud Storage boilerplate with aiobotocore | infrastructure |
| terraform | Infrastructure-as-Code with Terraform for AWS and GCP | deployment |
| testing | pytest + pytest-asyncio + httpx with factory-boy fixtures | development |
| users | User model, CRUD service, and admin endpoints | core |
| websockets | WebSockets with Redis Pub/Sub for multi-worker broadcasting | infrastructure |
CLI Commands
# Create a new project
moltpy new
# Preview without writing files
moltpy new --name my_api --preset standard --dry-run --no-interactive
# Generate from a config file
moltpy new --config-file moltpy.yaml --no-interactive
# Skip post-generation hooks (uv sync, git init, pre-commit)
moltpy new --name my_api --preset standard --skip-post-generation --no-interactive
# Generate a starter config file
moltpy init-config --preset standard --output moltpy.yaml
# List available modules
moltpy modules list
# Show module details
moltpy modules info auth
# List presets
moltpy presets list
# Save custom preset
moltpy preset save --name my-preset --modules auth,database,docker
# Generate a CRUD resource in an existing project
moltpy generate resource Post title:str content:text is_published:bool
Generated Project Structure
my-api/
├── app/
│ ├── __init__.py
│ ├── main.py # Application entry point
│ ├── config.py # Configuration management
│ ├── dependencies.py # Dependency injection
│ ├── routers/ # API route handlers
│ ├── models/ # Database models
│ ├── services/ # Business logic
│ ├── templates/email/ # Email templates (when email module selected)
│ └── utils/ # Utility functions
├── tests/ # Test suite
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── grafana/ # Grafana provisioning and dashboards (when observability selected)
├── terraform/ # Infrastructure-as-Code (when terraform selected)
├── .github/
│ └── workflows/
│ └── ci.yml
├── docs/
│ └── modules.md # Auto-generated module catalog
├── pyproject.toml # Project dependencies
├── Makefile # Common commands
├── CONTRIBUTING.md # Auto-generated contributing guide
├── .pre-commit-config.yaml # Pre-commit hooks
├── .env.example # Environment template
└── README.md # Project documentation
Development
# Clone the repository
git clone https://github.com/iolimat/moltpy.git
cd moltpy
# Install dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Run linting
uv run ruff check .
# Format code
uv run ruff format .
Contributing
We welcome contributions. Please see CONTRIBUTING.md for guidelines.
External Modules
MoltPy supports loading modules from external sources:
- Local directory: Place modules in
~/.config/moltpy/modules/<name>/ - GitHub: Reference with
github:user/repo#module-name
See Custom Modules for details.
Adding a New Module
- Create
src/moltpy/modules/<module_name>/ - Add
manifest.jsonwith metadata - Add
templates/with Jinja2 files - Add
snippets/for shared-file injections (optional) - Open a pull request
License
Acknowledgments
Metadata
Release files for moltpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| moltpy-0.1.1.tar.gz | 985.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moltpy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / moltpy-0.1.1.tar.gz
| Download URL | moltpy-0.1.1.tar.gz |
|---|---|
| Size | 985.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ed8c4ded9277f632a6c881f1791a3b0ea7f1bc494bdf6fdb76390d014664fbf
|
|
BLAKE2b-256 checksum How to use checksums |
b629d4bbeea32525db8887a82b6778bb5dea94b6d2cd1b89bf1982be43bd5199
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / moltpy-0.1.1-py3-none-any.whl
| Download URL | moltpy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 153.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bd4de75e8b190c2b16fdbb050510e57773ef80fe1851a77601ed03823f817ef
|
|
BLAKE2b-256 checksum How to use checksums |
e69d7de616bde9a42c3a643c3138fbbfbbc1f2f561347556dc7330447920aff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for moltpy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.