{ "info": { "author": "Prashant Sinha", "author_email": "prashant@ducic.ac.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "MongoCapsule\n============\n\n|Build Status|\n\n|Code Climate|\n\n|Test Coverage|\n\n|PyPI|\n\n|PyPI|\n\nOverview\n--------\n\nMongoCapsule is a very thin wrapper around MongoEngine built for your\nhappiness. It encapsulates MongoEngine attributes under a single\nnamespace and hence allows explicit declaration without context\nswitches.\n\nIn addition to that, MongoCapsule adds pagination support to all the\nquery results.\n\nMongoEngine is a great ORM for using MongoDB in any Python project.\nHowever, since MongoEngine works in \u201ccontexts\u201d, using multiple databases\nrequires trickery such as ``db_alias`` and ``switch_db``. MongoCapsule\nsolves this by attaching references to MongoEngine attributes to itself.\n\nQuickstart\n----------\n\nIf you are familiar with MongoEngine, you can use MongoCapsule already!\nCreate the database object and use it to define your document and\nfields.\n\n.. code:: python\n\n from mongocapsule import MongoCapsule\n\n db = MongoCapsule('test_db')\n\n class Fruits(db.Document):\n name = db.StringField()\n\nRefer to `MongoEngine Docs`_ for details.\n\nInstallation\n------------\n\nTo install use pip:\n\n.. code:: bash\n\n pip install mongocapsule\n\nOr clone the repo:\n\n.. code:: bash\n\n git clone https://github.com/prashnts/mongocapsule.git\n python setup.py install\n\nAdditional API\n--------------\n\nMongoCapsule adds Pagination support to the MongoEngine ``QuerySet``\nobject. It returns 10 objects per page, however, this can be changed.\n\n.. code:: python\n\n\n # Obtain nth Page of any arbitrary query:\n\n query_results = Document.objects(...).sort(...)\n\n result_page = query_results.page(2) # Obtain second page\n\n total_pages = query_results.page_count\n\n # Update number of items returned per page:\n\n db.QuerySet.set_page_limit(20)\n\nContributing\n------------\n\nCode Patches, suggestions and bug reports welcome! Please use GitHub\nissues for the same.\n\nRant\n----\n\nI wrote this module because the examples in official MongoEngine\ndocumentation encourages using ``from mongoengine import *`` which not\nonly pollutes the local namespace, but makes class definitions implicit.\nOf course, cherrypicked imports are possible, however that requires a\nlot of extra imports in each files.\n\nThe biggest problem, however, comes when you\u2019re using multiple databases\nor hosts \u2013 in those cases, you need to use context switches or ugly\n``meta`` attributes in the declaration.\n\n.. _MongoEngine Docs: http://docs.mongoengine.org/index.html\n\n.. |Build Status| image:: https://img.shields.io/travis/prashnts/mongocapsule/master.svg\n :target: https://travis-ci.org/prashnts/mongocapsule\n.. |Code Climate| image:: https://img.shields.io/codeclimate/github/prashnts/mongocapsule.svg\n :target: https://codeclimate.com/github/prashnts/mongocapsule\n.. |Test Coverage| image:: https://img.shields.io/codeclimate/coverage/github/prashnts/mongocapsule.svg\n :target: https://codeclimate.com/github/prashnts/mongocapsule\n.. |PyPI| image:: https://img.shields.io/pypi/pyversions/mongocapsule.svg?maxAge=2592000\n :target: https://pypi.python.org/pypi/mongocapsule\n.. |PyPI| image:: https://img.shields.io/pypi/v/mongocapsule.svg?maxAge=2592000\n :target: https://pypi.python.org/pypi/mongocapsule", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/prashnts/mongocapsule/tarball/0.1.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/prashnts/mongocapsule", "keywords": "", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "mongocapsule", "package_url": "https://pypi.org/project/mongocapsule/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mongocapsule/", "project_urls": { "Download": "https://github.com/prashnts/mongocapsule/tarball/0.1.2", "Homepage": "https://github.com/prashnts/mongocapsule" }, "release_url": "https://pypi.org/project/mongocapsule/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Encapsulated MongoEngine.", "version": "0.1.2" }, "last_serial": 2191626, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ccb2813ec0720855efd0528b290b59c0", "sha256": "2f9903d823ea76e46c46603542aa8d5ce552704cbb39d53b8596dea209539b72" }, "downloads": -1, "filename": "mongocapsule-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ccb2813ec0720855efd0528b290b59c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2439, "upload_time": "2016-06-28T11:03:42", "url": "https://files.pythonhosted.org/packages/37/31/c7650a6ba0907344b709fde9e80540ebbe176ed9288c75c5d24e0646a347/mongocapsule-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "75b626743f273f7ef034e83ae1f40f09", "sha256": "ee8a024e2575f16c787e62ffa2bb35a4c2ead18e56957599a406eb480e249da6" }, "downloads": -1, "filename": "mongocapsule-0.1.1.tar.gz", "has_sig": false, "md5_digest": "75b626743f273f7ef034e83ae1f40f09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4324, "upload_time": "2016-06-28T13:15:02", "url": "https://files.pythonhosted.org/packages/f3/0d/2289001e5ad2a055dba75428cd8480585e153af306a4d8b4bb964a8356f5/mongocapsule-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "95ef6b8ec7239e0d7589971114959b68", "sha256": "abed0c565c17b0fd5e2d19a577084eb08d42eaa0b34f500e2404bf4c8e2f52be" }, "downloads": -1, "filename": "mongocapsule-0.1.2.tar.gz", "has_sig": false, "md5_digest": "95ef6b8ec7239e0d7589971114959b68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4320, "upload_time": "2016-06-28T13:23:22", "url": "https://files.pythonhosted.org/packages/b2/1b/f00c6ecfe7966a43dfb63b3066dd831ee81c1d7fd99216a68bf1cd9e4dd6/mongocapsule-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95ef6b8ec7239e0d7589971114959b68", "sha256": "abed0c565c17b0fd5e2d19a577084eb08d42eaa0b34f500e2404bf4c8e2f52be" }, "downloads": -1, "filename": "mongocapsule-0.1.2.tar.gz", "has_sig": false, "md5_digest": "95ef6b8ec7239e0d7589971114959b68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4320, "upload_time": "2016-06-28T13:23:22", "url": "https://files.pythonhosted.org/packages/b2/1b/f00c6ecfe7966a43dfb63b3066dd831ee81c1d7fd99216a68bf1cd9e4dd6/mongocapsule-0.1.2.tar.gz" } ] }