Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tevino/mongu

:seedling: Yet another Python Object-Document Mapper on top of PyMongo. It's lightweight, intuitive to use and easy to understand.
https://github.com/tevino/mongu

mongodb odm pymongo python

Last synced: about 1 month ago
JSON representation

:seedling: Yet another Python Object-Document Mapper on top of PyMongo. It's lightweight, intuitive to use and easy to understand.

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/tevino/mongu.svg?branch=master)](https://travis-ci.org/tevino/mongu)
[![Coverage Status](https://coveralls.io/repos/github/tevino/mongu/badge.svg?branch=master)](https://coveralls.io/github/tevino/mongu?branch=master)

# Introducing to Mongu
**Mongu** is yet another Python Object-Document Mapper on top of ``PyMongo``. It's lightweight, intuitive to use and easy to understand.

If those **heavy and slow layers** have nothing or more than you need, Mongu maybe the one for you.

You are the only one who knows what you reall need.

Therefor **Mongu does nothing but a skeleton for you to fill**.

Actually, if you have ever tried to write your own ODM, you may already implemented parts of Mongu :D

# Installation
pip install mongu

# Dependences
- pymongo >= 2.7

*Older(not ancient) version should work just fine, but 2.7 is tested.*

# Documentation
## A really quick example

c = Client()
@c.register_model
class User(Model):
_database_ = 'test'
_collection_ = 'users'
_defaults_ = {'is_activated': False} # default attribute

>> user = User(name='Mongu')
User({'name': 'Mongu', 'is_activated': False})
>> user.save()
User({'name': 'Mongu', 'is_activated': True, '_id': ObjectId('534f81bd7246ef6955d2388f')})

For more detailed examples and API: http://mongu.readthedocs.org

# License
Code and documentation are available according to the MIT License.

# Send feedback!
If you thought Mongu is helpful, please [tell me](mailto:[email protected]), a brif message like “This is what I always wanted” is enough, I would love to know!

Of course by all means feel free to send pull requests or create issues, it's always welcome and appreciated.

Thanks!