Skip to main content

MongoSchematic CLI for MongoDB schema analysis, drift detection, and migrations

Project description

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.

License Python MongoDB

Features

  • 🔍 Schema Inference: Automatically infer schemas from your MongoDB collections.
  • 🚨 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.

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

mongo_schematic-0.1.1.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

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

mongo_schematic-0.1.1-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file mongo_schematic-0.1.1.tar.gz.

File metadata

  • Download URL: mongo_schematic-0.1.1.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mongo_schematic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f1aee7b55c351c7824ec433140a28a5410fd8893c328ab008b47c788326b47b
MD5 7c8c282046dc5e7ffa89e5fe23c52e2b
BLAKE2b-256 08d4a9e283547e9e8a89a1a3502df71e38b2b55479f87358b3aefe6ede42b9c6

See more details on using hashes here.

File details

Details for the file mongo_schematic-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mongo_schematic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ccddf6c0703ac6b528bd02bc5cd800afa1ced5adc4edd0adb4887bf36d90ca8
MD5 b9a7e9f1248c6623fa208e83f1e64049
BLAKE2b-256 4298ae735dd766664e6ac6bfa0acaf7b3f3254ae19af90066afa8ea82488a60d

See more details on using hashes here.

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