Registry / database / montydb

montydb

JSON →
library2.5.6pypypi✓ verified 84d ago

Monty, Mongo tinified. MongoDB implemented in Python. Current version 2.5.6, supports Python >=3.7. Released irregularly.

pip install montydb
INSTALL
IMPORT
SIG · MONTYDB
M
montydb
databasepythonv2.5.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MontyClient
from montydb import MontyClient
from monty import MontyClient
'monty' is not a valid module; must use 'montydb'.
connect
from montydb import connect
from pymongo import MongoClient
MontyDB mimics pymongo but is a separate library; using pymongo will connect to a real MongoDB instead.

Create an in-memory database and perform basic CRUD.

from montydb import MontyClient, connect # Using MontyClient with in-memory storage client = MontyClient() db = client.test_db collection = db.test_collection collection.insert_one({'name': 'Alice', 'age': 30}) print(collection.find_one({'name': 'Alice'}))
montydb --version
Debug
Known issues
gotchaMontyDB's 'import montydb' is correct, but users often mistakenly import 'monty' or 'montydb.client'.
fix
Use 'from montydb import MontyClient' or 'from montydb import connect'.
affects: all
gotchaMontyDB is not fully compatible with all MongoDB features; aggregation pipelines with unsupported operators may raise NotImplementedError.
fix
Check the documentation for supported operators; use native Python logic if needed.
affects: all
breakingVersion 2.5.0 introduced support for mongoengine but changed internal storage engine; existing databases may need migration.
fix
Back up your montydb data directory before upgrading, or use in-memory mode temporarily.
affects: >=2.5.0
gotchaIn-memory databases are per-process; they do not persist after restart. Users expecting persistence must specify a storage path.
fix
Use MontyClient(repository='path/to/data') for persistent file-based storage.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'monty'
Incorrect import; users attempt 'import monty' instead of 'montydb'.
fix
Run 'pip install montydb' and use 'from montydb import MontyClient'.
pymongo.errors.ServerSelectionTimeoutError: No primary server found
Using pymongo's MongoClient with MontyDB's connection string. MontyDB does not start a real MongoDB server.
fix
Use MontyClient from montydb, not pymongo's MongoClient.
NotImplementedError: The 'collStats' command is not supported
Attempt to use aggregation pipeline operators not implemented by MontyDB (e.g., $collStats).
fix
Replace unsupported operators with equivalent Python code or use simpler queries.
Upgrade
Version history
2.5.6latest on PyPI · released Nov 1, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Meta
1
Resources
montydb — pip install montydb · libregistry