Skip to main content

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(), and delete() 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 connection
  • cli: Command-line interface helpers
  • io: CSV/JSON import/export
  • aliasing: Define shortcuts for collection names
  • utils: 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

Sponsored by GitAds

🙌 Author

Made with ❤️ by Prakhar Doneria

Metadata

Release files for mongo-easy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongo-easy 0.1.1
File Size Uploaded
mongo_easy-0.1.1.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mongo-easy 0.1.1
File Interpreter ABI Platform
mongo_easy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / mongo_easy-0.1.1.tar.gz

Download URL mongo_easy-0.1.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
28e38aa467f9701ccf3556715141056de4368f90083e11dccedc45d9834e2ea7
BLAKE2b-256 checksum
How to use checksums
9ccf0fd10fc98334d49f44bfb571f1701c228db7bc2dd3cb1bffb86d4c4f3325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / mongo_easy-0.1.1-py3-none-any.whl

Download URL mongo_easy-0.1.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eaf9a25f85d50b9dc1d3cacf44c7e71964ddca77b5b20d089cda22b0b2d29db8
BLAKE2b-256 checksum
How to use checksums
544bc37f3dd3ec82580d1f9218d9821fde60df5a28e3cbd77b93956c9753abb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page