Skip to main content
MongoMonkey
============

MongoMonkey is a simple ODM for mongo.
The key idea was to use standard pymongo api, without overriding it.

Example of usage:
-------------

```python
from pymongo import Connection
from mongomonkey import Model, Field, list_of

class Book(Model):
title = Field(unicode)
page_count = Field(int)

class Author(Model):
name = Field(unicode)
books = Field(list_of(Book))

connection = Connection()
db = connection.test_database
collection = db.test_collection

book1 = Book(title=u"Alice's Adventures in Wonderland", page_count=191)
author = Author(name=u"Lewis Carroll")
# Accessing by field attribute
author.books = [book1]
# Accessing like dict item
author['books'].append({u"title": u"A Tangled Tale", u"page_count": 152})

# Saving object
collection.save(author) # By default pymongo would attach '_id' to this document.

# Retrieving object
author = collection.find_one(as_class=Author)
```

Recursive embedding:
-------------

```python
from mongomonkey import Model, Field, list_of

class Node(Model):
title = Field(unicode)
# You can use 'self' to point on currently creating Model
child1 = Field('self')
# Also you can use a name of a model to point on it
child2 = Field('Node')

# Printing instance of Node
print Node(title=u"root", child1=Node(title=u"Child1"), child2=Node(title=u"Child2"))
```

Developing and Contributing
-------------

If you have any question, ideas or improvements feel free to fork or add an issue
on github http://github.com/xonatius/mongo-monkey

Metadata

Release files for mongomonkey 0.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 mongomonkey 0.1
File Size Uploaded Provenance
mongomonkey-0.1.tar.gz 6.5 kB Without provenance Details

Release files / mongomonkey-0.1.tar.gz

Download URL mongomonkey-0.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b4364541abee5a6d21a0c415bec5f3faf31acd3d9edf207b12c54975a8ffb9a5
BLAKE2b-256 checksum
How to use checksums
139e53a4fad7eb517259bc43638df17a11afa77a5b2a56e85d7399ec47712a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for mongomonkey 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

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