Skip to main content

minimongo

Info:

Minimal database Model management for MongoDB.

Author:

Steve Lacy (github@slacy.com)

About

minimongo is a lightweight, schemaless, Pythonic Object-Oriented interface to MongoDB.

It provides a very thin, dynamicly typed (schema-less) object management layer for any data stored in any MongoDB collection. minimongo directly calls the existing pymongo query syntax.

minimongo can easily layer on top of existing MongoDB collections, and will work properly with almost any existing schema, even from third party applications.

Installation

If you have setuptools you can use easy_install -U minimongo. Otherwise, you can download the source from GitHub and run python setup.py install.

Dependencies

  • pymongo 1.9+

  • sphinx (optional – for documentation generation)

Example

Here’s a very brief example of creating an object, querying for it, modifying a field, and then saving it back again:

from minimongo import Model, Index

class Foo(Model):
    class Meta:
        # Here, we specify the database and collection names.
        # A connection to your DB is automatically created.
        database = "minimongo"
        collection = "rocks"

        # Now, we programatically declare what indices we want.
        # The arguments to the Index constructor are identical to
        # the args to pymongo"s ensure_index function.
        indices = (
            Index("a"),
        )


if __name__ == "__main__":
    # Create & save an object, and return a local in-memory copy of it:
    foo = Foo({"x": 1, "y": 2}).save()

    # Find that object again, loading it into memory:
    foo = Foo.collection.find_one({"x": 1})

    # Change a field value, and save it back to the DB.
    foo.other = "some data"
    foo.save()

Feedback welcome!

Please email github@slacy.com with comments, suggestions, or comment via http://github.com/slacy/minimongo

Metadata

Release files for minimongo 0.2.8

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

Source distribution (sdist)

Source distribution for minimongo 0.2.8
File Size Uploaded Provenance
minimongo-0.2.8.tar.gz 15.1 kB Without provenance Details

Release files / minimongo-0.2.8.tar.gz

Download URL minimongo-0.2.8.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
71300d93bee666456dfe65de03cc79be1ffb64b3e25d18c3f32e59c964e6b3d7
BLAKE2b-256 checksum
How to use checksums
fd37ee62e20d23c0871bf6f4fbd92fede186a393eaeaaaa1eae1628a807936a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for minimongo 0.2.8

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.

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