Skip to main content

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(), 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 ⭐


🙌 Author

Made with ❤️ by Prakhar Doneria

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_easy-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

mongo_easy-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file mongo_easy-0.1.0.tar.gz.

File metadata

  • Download URL: mongo_easy-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mongo_easy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4f18a3f3435f3e21efc95431e4b991cae7b6459eb34e9aa50deead6298945ad
MD5 3d0704af46c66ece5432544f13e52adb
BLAKE2b-256 249cbe624dff4c25767d854801d41e7d3759035caa13ed072f15804e2854a4a7

See more details on using hashes here.

File details

Details for the file mongo_easy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mongo_easy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mongo_easy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab73c5b8100cc3403bc431f442a4263a1c4327004c50530ba94b098ba7a8230
MD5 71540db71358d8e7b5d7ad9882fd6144
BLAKE2b-256 e7b264e5cbbceda3c648370204f0472192c2ccd3e96e40f2ea0f2057ba9e00f2

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