A simple and intuitive MongoDB helper library for everyone
Project description
Mongo Easy 🧠🍃
Mongo Easy is a beginner-friendly Python library that makes working with MongoDB super simple and readable — even for non-coders. Whether you're building a script, a CLI tool, or just learning databases, Mongo Easy helps you do CRUD operations with minimal setup and code.
🔥 Features
- ⚡ One-line
connect()to MongoDB - 📁 Simple
save(),find(),update(), anddelete()functions - 🧰 Optional collection aliases (
alias("users", "u")) - 🧪 Easy-to-read code — perfect for learners or quick scripting
- 💻 Built-in CLI to run MongoDB operations from your terminal
- 📤 CSV/JSON import/export
- 🧪 Test suite included
- 🧩 Custom utils for common DB tasks
🚀 Installation
pip install mongo-easy
Or clone for development:
git clone https://github.com/prakhardoneria/mongo_easy.git
cd mongo_easy
pip install -e .
🛠️ Quick Start
from mongo_easy.core.connection import connect
from mongo_easy.core.crud import save, find
connect() # connect to local MongoDB
# Insert a document
save("users", {"name": "Alice", "age": 30})
# Query documents
users = find("users", {"age": {"$gte": 18}})
print(users)
🧪 CLI Usage
# List all collections
mongo-easy list
# Insert a user
mongo-easy insert users --data '{"name": "Bob", "age": 25}'
# Find users
mongo-easy find users --filter '{"age": {"$gt": 20}}'
🧩 Modules
core: Core CRUD operations + MongoDB connectioncli: Command-line interface helpersio: CSV/JSON import/exportaliasing: Define shortcuts for collection namesutils: Common utility functions for MongoDB operations
🧰 Example
from mongo_easy import connect, save, find
connect("mongodb://localhost:27017", db_name="school")
save("students", {"name": "John", "grade": "A"})
students = find("students", {"grade": "A"})
for s in students:
print(s)
📁 Project Structure
mongo_easy/
├── core/
├── cli/
├── io/
├── aliasing/
├── utils/
├── tests/
├── examples/
└── docs/
📄 Docs
🧪 Testing
pytest
Use mongomock for offline tests (optional).
🤝 Contributing
Pull requests are welcome! Check out the Contributing Guide (or create one!) to get started.
📝 License
MIT License. Use it freely and star it if you love it ⭐
GitAds Sponsored
🙌 Author
Made with ❤️ by Prakhar Doneria
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mongo_easy-0.1.1.tar.gz.
File metadata
- Download URL: mongo_easy-0.1.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28e38aa467f9701ccf3556715141056de4368f90083e11dccedc45d9834e2ea7
|
|
| MD5 |
2c88a3be65a4cec3f34f4abdf4da6664
|
|
| BLAKE2b-256 |
9ccf0fd10fc98334d49f44bfb571f1701c228db7bc2dd3cb1bffb86d4c4f3325
|
File details
Details for the file mongo_easy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mongo_easy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf9a25f85d50b9dc1d3cacf44c7e71964ddca77b5b20d089cda22b0b2d29db8
|
|
| MD5 |
c2268d63d47fe9daf7a498bea499f658
|
|
| BLAKE2b-256 |
544bc37f3dd3ec82580d1f9218d9821fde60df5a28e3cbd77b93956c9753abb3
|