A lightweight, optimistic, and efficient CRUD layer for MongoDB — built with safety, validation, built-in logging, and error handling, all designed for simplicity and reliability.
- ✅ Automatic error handling
- 🧩 Integrated logging for all operations
- 🔒 Full Pydantic model support
- 🔁 Type-safe input and output using Pydantic BaseModels
pip install mongoguardfrom mongoguard import MongoGuard
from pydantic import BaseModel
mg = MongoGuard(
mongo_url="mongodb://localhost:27017/",
db_name="Example",
collection_name="User"
)
class UserModel(BaseModel):
id: int
name: str
email: str
password: str
mg.fetch_collection(out_model=UserModel)Created and maintained by Mukund Thorat.
We welcome contributors to help improve MongoGuard! If you are interested in contributing or collaborating, please contact me via email: mukundthorat.official@gmail.com
This project is licensed under the terms of the MIT license.