MongoSchematic CLI
MongoSchematic is a modern, developer-first tool for MongoDB schema management. It helps you infer schemas from existing data, detect drift, generate code, and handle migrations with confidence.
Features
- Schema Inference: Automatically infer schemas from your MongoDB collections.
- Full BSON Support: All MongoDB types including
binData,regex,long,timestamp, and union types. - Drift Detection: Detect when your data deviates from your schema/models.
- Code Generation: Generate Pydantic models (Python) and TypeScript interfaces.
- Documentation: Build static HTML documentation for your database.
- Data Seeding: Populate your database with realistic dummy data.
- Migrations: Generate and execute versioned migration scripts.
- Validation: Validate documents against your defined schemas.
- AI-Powered: Optional Gemini AI integration for schema recommendations.
Installation
pip install mongo-schematic
Quick Start
1. Initialize
Generate a default configuration file:
mschema init
2. Analyze a Collection
Infer the schema from an existing collection and save it:
mschema analyze --collection users --save schemas/users.v1.yml
3. Generate Code
Create a Pydantic model for your application:
mschema generate models --schema schemas/users.v1.yml --type pydantic --out models/user.py
4. Detect Drift
Check if your live data matches your schema:
mschema drift detect --schema schemas/users.v1.yml --collection users
Documentation
For full usage details including database-wide commands, CI/CD integration, and migration workflows, see the Usage Guide.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for mongo-schematic 0.1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mongo_schematic-0.1.4.4.tar.gz | 36.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mongo_schematic-0.1.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.7 kB
Release files / mongo_schematic-0.1.4.4.tar.gz
| Download URL | mongo_schematic-0.1.4.4.tar.gz |
|---|---|
| Size | 36.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
033662f3f6937bdd5b4f626a04e7a0f156c8d04a7c8339e6d74817266bb35b90
|
|
BLAKE2b-256 checksum How to use checksums |
65c32e776b864fa9ac652f7855c1bdc56d37853c40e6dc39051c03e91bae7f84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / mongo_schematic-0.1.4.4-py3-none-any.whl
| Download URL | mongo_schematic-0.1.4.4-py3-none-any.whl |
|---|---|
| Size | 38.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fa2e9b4ae113e9848a62fcf447fc0f1217d0677fea3aa4ef5bad5ef55730477
|
|
BLAKE2b-256 checksum How to use checksums |
82de644a054ab246020236721d704aeab55db77439b3843ca0d926332b97f6a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|