{ "info": { "author": "Marco Pazzaglia", "author_email": "marco@pazzaglia.me", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/marcopaz/pyjo_mongo.svg?branch=master)](https://travis-ci.org/marcopaz/pyjo_mongo)\n\n# pyjo_mongo\n\nA light wrapper around pymongo and pyjo to easily interact with MongoDB documents. See the following example.\n\n## Install\n\n```\npip install pyjo_mongo\n```\n\n## How to use\n\n```python\nfrom pymongo import MongoClient\nfrom pyjo import Model, Field, RangeField, EnumField\nfrom pyjo_mongo import Document\n\ndb_connection = MongoClient(MONGODB_URL)[DB_NAME]\n\n\nclass Gender(Enum):\n female = 0\n male = 1\n\n\nclass Address(Model):\n city = Field(type=str)\n postal_code = Field(type=int)\n address = Field()\n\n\nclass User(Document):\n __meta__ = {\n 'db_connection': lambda: db_connection,\n 'collection_name': 'users',\n 'indexes': [\n {\n 'fields': ['username'],\n 'unique': True,\n 'index_background': True,\n },\n ['first_name', 'last_name'],\n ],\n }\n\n username = Field(type=str, repr=True, required=True)\n first_name = Field(type=str)\n last_name = Field(type=str)\n age = RangeField(min=18, max=120)\n gender = EnumField(enum=Gender)\n address = Field(type=Address)\n active = Field(type=bool, default=True)\n```\n\n```python\nu = User(username='mp')\nu.id\n# None\nu.save()\nu.id\n# ObjectId('5a5ca86080a9b8291874f4db')\n\n# objects is a class property built around a pymongo Cursor\n# and will allow you to perform basic operations\n\nu2 = User.objects.find_one({'username': 'mp'})\nu2.gender = Gender.male\nu2.save()\n\nu.reload()\nu.gender\n# Gender.male\n\n# queries use the same syntax of pymongo and automatically return pyjo data models\nfor user in User.objects.find({'active': True}):\n print(user)\n# \n\n# You can perform ordering operations on querysets\nfor user in User.objects.order_by('gender', '-age'):\n print(user.username)\n print(user.age)\n\n\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/marcopaz/pyjo_mongo/archive/0.9.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/marcopaz/pyjo_mongo", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyjo-mongo", "package_url": "https://pypi.org/project/pyjo-mongo/", "platform": "", "project_url": "https://pypi.org/project/pyjo-mongo/", "project_urls": { "Download": "https://github.com/marcopaz/pyjo_mongo/archive/0.9.1.tar.gz", "Homepage": "https://github.com/marcopaz/pyjo_mongo" }, "release_url": "https://pypi.org/project/pyjo-mongo/0.9.1/", "requires_dist": null, "requires_python": "", "summary": "Pyjo for MongoDB", "version": "0.9.1" }, "last_serial": 5541089, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0c37e4392f96591090348d4e8e6ebcf9", "sha256": "abf2e81cd8d4866633638791fee0ddb13d6a3b7dcf66b1c8e155b261b36630c5" }, "downloads": -1, "filename": "pyjo_mongo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c37e4392f96591090348d4e8e6ebcf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3816, "upload_time": "2018-01-16T13:58:26", "url": "https://files.pythonhosted.org/packages/48/67/8756213f3e7327d3d48dd05e77bb5f4e9ea84e598cf397815c81217a9281/pyjo_mongo-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "cf1718765f9f568491bbcc7a6e87e039", "sha256": "5773dca60b373987fa063ebb204d8756cea1924c600b72f61cbe2b59668a1603" }, "downloads": -1, "filename": "pyjo_mongo-0.1.1.tar.gz", "has_sig": false, "md5_digest": "cf1718765f9f568491bbcc7a6e87e039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3784, "upload_time": "2018-01-16T14:21:17", "url": "https://files.pythonhosted.org/packages/6a/71/b183dfc222a7a9595cf58488db0b129104b97189654d4457613ea72baf56/pyjo_mongo-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "07052d9e2402200be851ec11f2303a48", "sha256": "ef3a7c16fd6b93399178022be4c0f310bf97fb8168325fb0b4a8a5c0999e557a" }, "downloads": -1, "filename": "pyjo_mongo-0.2.0.tar.gz", "has_sig": false, "md5_digest": "07052d9e2402200be851ec11f2303a48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3865, "upload_time": "2018-01-18T09:37:18", "url": "https://files.pythonhosted.org/packages/2a/8b/c683c56491425d6265fadc73c5dfc73f2473dd7a506a4296a4dc238597e7/pyjo_mongo-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "68c8559ef2de37e3a7280da40cf22d2b", "sha256": "adf8cb4fd1d34033a0ad467349217dee4fe32108a5783dde29163e8614fe61ae" }, "downloads": -1, "filename": "pyjo_mongo-0.2.1.tar.gz", "has_sig": false, "md5_digest": "68c8559ef2de37e3a7280da40cf22d2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3851, "upload_time": "2018-01-22T09:40:03", "url": "https://files.pythonhosted.org/packages/86/d6/fe51b7066e1df4f9d474b34ad8e27a972c5ab059fb18dcb3003eb6a5d2a9/pyjo_mongo-0.2.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "733353805b65bf88b34b4fa821f8f93c", "sha256": "c389243b70cc323a4ba918275757087ca550b6baf366126b75a812d82ad908fe" }, "downloads": -1, "filename": "pyjo_mongo-0.4.0.tar.gz", "has_sig": false, "md5_digest": "733353805b65bf88b34b4fa821f8f93c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5529, "upload_time": "2018-01-31T14:28:53", "url": "https://files.pythonhosted.org/packages/23/8e/1dbc83f85a2b1646ea69f61a9818c1c47b08878d38839d28c297ad75aab4/pyjo_mongo-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "9939e0270c3a4347d257a0e4b14db961", "sha256": "d5c6ff407f9fa2aad7dd63618bd666622f679f851c3037c7d55d2fedfe37eb94" }, "downloads": -1, "filename": "pyjo_mongo-0.5.0.tar.gz", "has_sig": false, "md5_digest": "9939e0270c3a4347d257a0e4b14db961", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5652, "upload_time": "2018-02-12T17:14:11", "url": "https://files.pythonhosted.org/packages/66/c4/0d4c1f33efb241fa6b87925cf65cc4be121774bd6c207f5a3be5e5000d9b/pyjo_mongo-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "9e5cc3812561e745d6370cb60c204500", "sha256": "a05b23e9c000a9ced7f3f70550e7aa91d6310c30b4b2be91c2629411e4526b30" }, "downloads": -1, "filename": "pyjo_mongo-0.6.0.tar.gz", "has_sig": false, "md5_digest": "9e5cc3812561e745d6370cb60c204500", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6030, "upload_time": "2018-03-24T03:10:15", "url": "https://files.pythonhosted.org/packages/91/a9/92e9d12027b23c2e4ca1becc3e34046349878d41d3b6e3607dcf86d77344/pyjo_mongo-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "a2aeeb549c8879ecf500fe066f66e318", "sha256": "ebf832a28dde9e233c1954c1c6ad2d3e36065e0b7757327abf449451a41f0455" }, "downloads": -1, "filename": "pyjo_mongo-0.7.0.tar.gz", "has_sig": false, "md5_digest": "a2aeeb549c8879ecf500fe066f66e318", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6047, "upload_time": "2018-05-10T12:38:21", "url": "https://files.pythonhosted.org/packages/35/ac/d0216dd6e149b9cd3dbd854ae9d0af3e29f5f7f14d39cc28ce2c49372578/pyjo_mongo-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "dddc2849e95ad011461cdd43fb482a4f", "sha256": "92c4e4a1bb51abae3418b33277354bac3c87f277729637b23ff2cfbfdbb89b31" }, "downloads": -1, "filename": "pyjo_mongo-0.7.1.tar.gz", "has_sig": false, "md5_digest": "dddc2849e95ad011461cdd43fb482a4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6114, "upload_time": "2018-08-13T15:19:37", "url": "https://files.pythonhosted.org/packages/22/f2/dd31f9936aa2ef99128c826603e7fd5f84d0c03a7d34b30a3b936ec48c4d/pyjo_mongo-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "b0bfe8ddcd91efbc72574f558e6eebd9", "sha256": "61bce6ec05e35c110b6417cd682c0d3270b769e687240bdcb66608d8697eeb28" }, "downloads": -1, "filename": "pyjo_mongo-0.8.0.tar.gz", "has_sig": false, "md5_digest": "b0bfe8ddcd91efbc72574f558e6eebd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6207, "upload_time": "2019-01-16T09:54:19", "url": "https://files.pythonhosted.org/packages/03/e7/86b3430222892986ae24a5eb466d5296aaf3a96fb850c84a0b7db7d17fc5/pyjo_mongo-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "4f6bd92f3c7db93f159dbc001d0d47fd", "sha256": "ed6a19e861001e66cff5c13bda0200fc981d60e92b011e0d25b829f54bbd6c1c" }, "downloads": -1, "filename": "pyjo_mongo-0.8.1.tar.gz", "has_sig": false, "md5_digest": "4f6bd92f3c7db93f159dbc001d0d47fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6225, "upload_time": "2019-02-07T13:51:21", "url": "https://files.pythonhosted.org/packages/98/d0/60e18778a9025275b86ff27f968fbcc3856fc8134f3a91f2a471816b537f/pyjo_mongo-0.8.1.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "24efef4510fcb6b34a65b08278c6151f", "sha256": "50979fb46a5304ac4acf43d2b53c7c78083b1c55fce57827988f60726c9f2bd9" }, "downloads": -1, "filename": "pyjo_mongo-0.9.1.tar.gz", "has_sig": false, "md5_digest": "24efef4510fcb6b34a65b08278c6151f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6435, "upload_time": "2019-07-16T14:53:59", "url": "https://files.pythonhosted.org/packages/fc/be/a1077c58a1c0831f5b1a4ccfc6c40a4f576c717b5804c271ba91daf6a1df/pyjo_mongo-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24efef4510fcb6b34a65b08278c6151f", "sha256": "50979fb46a5304ac4acf43d2b53c7c78083b1c55fce57827988f60726c9f2bd9" }, "downloads": -1, "filename": "pyjo_mongo-0.9.1.tar.gz", "has_sig": false, "md5_digest": "24efef4510fcb6b34a65b08278c6151f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6435, "upload_time": "2019-07-16T14:53:59", "url": "https://files.pythonhosted.org/packages/fc/be/a1077c58a1c0831f5b1a4ccfc6c40a4f576c717b5804c271ba91daf6a1df/pyjo_mongo-0.9.1.tar.gz" } ] }