MongoAlchemy Publisher's description
from Jeffrey Jenkins
MongoAlchemy is a layer on top of the Python MongoDB driver which adds client-side schema definitions
MongoAlchemy is a layer on top of the Python MongoDB driver which adds client-side schema definitions, an easier to work with and programmatic query language, and a Document-Object mapper which allows python objects to be saved and loaded into the database in a type-safe way.
An explicit goal of this project is to be able to perform as many operations as possible without having to perform a load/save cycle since doing so is both significantly slower and more likely to cause data loss.
* Object-Document-Mapping: Turn MongoDB documents into Python objects and vice-versa.
* A rich expression language: which can be used to do queries for loading documents as well as updating documents without loading them.
* Use Any Collection and Field Names вЂ” Configuration allows collection names and field names to be different from their python names.
* Computed Fields ComputedField fields allow a function to be used to generate the value for a field. Extremely useful for fields where the value is a function (like a last-updated field), or where the field is generated from other fields (like a set of keywords generated or the components of a URL)
* User-defined validation вЂ” for values being wrapped for the database or unwrapped into a python object, as well as validators which happen for both. See Field
* Arbitrary Value Fields вЂ” A field that can hold arbitrary values: AnythingField
* More Flexible Mapping Type A dict-like field which can have arbitrary key and value types as well as allowing indexing on the keys вЂ” not normally possible in Mongo вЂ” by storing them in a different format than how they appear when accessed in python a plain dict. KVField
* Automatically Calculated Updates вЂ” The session object has an mongoalchemy.session.Session.update() function which determines which fields are dirty and will execute the appropriate update operations to update the object in the database. The operations used for updating can be overriden at the field definition level as well as in the update call.
* Drop into raw Mongo вЂ” Most functions will accept raw pymongo instead of the mongoalchemy objects. For example:
session.query('SomeClass').filter(SomeClass.name == foo).limit(5)``
is perfectly valid, as is:
System Requirements:В· Python
Program Release Status: Minor Update
Program Install Support: Install and Uninstall