{ "info": { "author": "Jonathan Mackenzie", "author_email": "pylons-discuss@googlegroups.com", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: WSGI" ], "description": "Pyramid Mongodb\n===============\n\nA simple library to integrate mongodb into your pyramid application. Comes with a debugtoolbar.\n\nFeatures\n--------\n\n* Supports multiple databases\n* Configuration only setup\n* Integrated debugtoolbar with:\n * Shows db response times\n * `explain()` for cursor results\n * Connection information\n * Database and collection stats\n* Avoids recreating and closing `MongoClient` on every request. \n\nSetup\n-----\n```bash\npip install pyramid_mongodb2\n```\n\nAdd the following to your application's ini file, (include `pyramid_mongodb2:MongoToolbar` in `debugtoolbar.includes` if you want to debug):\n\n```ini\n[app:main]\nmongo_uri = mongodb://username:password@mongodb.host.com:27017/authdb\nmongo_dbs = \n foo\n bar\n baz-quux\n foo-test = foo\npyramid.includes =\n pyramid_mako \n pyramid_debugtoolbar\n pyramid_mongodb2\ndebugtoolbar.includes =\n pyramid_mongodb2:MongoToolbar\n```\nThe code will use `config.add_request_method()` to add a `Database` object to your requests, where each database is accessible by `db_database_name`, as defined in your configuration.\n\n**Note**: database names with hyphens in them will be converted to underscores, that is database `baz-quux` will be accessible by `request.db_baz_quux`. \n\nWhen doing `foo-test = foo`, the mongodb database with name `foo-test` will be assigned to `request.db_foo`. \nThis helps when testing so that you can use a separate database for development, testing and production without\nchanging your application code, or if you just want to alias a database name.\n\n \nIn your code where you can access `request`, you now have the following variables:\n\n```python\nrequest.db\nrequest.db_foo\nrequest.db_bar\nrequest.db_baz_quux\nrequest.db_foo\n```\n`request.db` is the `MongoClient` object, should you ever need it.\n\nIn your view code, you can do this:\n\n```python\nfrom pyramid.view import view_config\n\n@view_config(route_name='home', renderer=\"templates/landing.mako\")\ndef my_view(request):\n return {\n 'some_data': request.db_foo.some_collection.find({'a': {'$gte': 5}}, {'_id': False}),\n 'other_data': request.db_bar.visitors.insert_one({'person': request.remote_addr}),\n }\n```\n\nDebugging\n---------\n\nWith debugging enabled, all queries will be logged in `request.query_log`, when the debugtoolbar is opened, you can \nthen view the execution time and `explain()` of cursor results. You can also see connection settings and stats for \ndatabases and collections.\n\nScreenshots\n-----------\n\nHere's what the toolbar looks like in action:\n\nClicking the database or collection name will take you to the relevant section of the collections tab. Clicking the operation name will take you to its pymongo documentation.\n![debug1](https://user-images.githubusercontent.com/650314/43239055-06890ce6-90d0-11e8-8761-53460bc65ced.png)\n\nClicking the explain button will show you the `explain()` result for a cursor.\n![debug2](https://user-images.githubusercontent.com/650314/43239051-05e0e8f4-90d0-11e8-93f4-8a4d1c42af14.png)\nYou can view detailed connection information here, clicking the field name will take you to the pymongo documentation for that field.\n![debug3](https://user-images.githubusercontent.com/650314/43239052-06099272-90d0-11e8-8cb0-d51465dd12a2.png)\nThis page show `dbstats` for all connected databases used in this request and their collections.\n![debug4](https://user-images.githubusercontent.com/650314/43239053-063631f6-90d0-11e8-9fc0-9703e4a70464.png)\nHere we can see the use of multiple databases in a single project.\n![debug5](https://user-images.githubusercontent.com/650314/43239054-065f8524-90d0-11e8-9a5a-889e8b23c207.png)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jonnoftw/pyramid_mongodb2", "keywords": "wsgi pylons pyramid mongodb pymongo", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyramid-mongodb2", "package_url": "https://pypi.org/project/pyramid-mongodb2/", "platform": "", "project_url": "https://pypi.org/project/pyramid-mongodb2/", "project_urls": { "Homepage": "https://github.com/jonnoftw/pyramid_mongodb2" }, "release_url": "https://pypi.org/project/pyramid-mongodb2/1.6.4/", "requires_dist": null, "requires_python": "", "summary": "An improved package that provides mongodb connectivity. Not compatible with pyramid_mongo or pyramid_mongodb", "version": "1.6.4" }, "last_serial": 5944875, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "56805d3e949f75e4d401fb546285dc03", "sha256": "502111cc71e8de84fb45f705b0da5b57d1c8f194e71c79619426040d25524091" }, "downloads": -1, "filename": "pyramid_mongodb2-1.1.tar.gz", "has_sig": false, "md5_digest": "56805d3e949f75e4d401fb546285dc03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2321, "upload_time": "2018-07-26T03:58:34", "url": "https://files.pythonhosted.org/packages/b7/32/dfde5394c0a59c0aa297d852e7293387d7bdd222e7db003eb4ae77ca78e6/pyramid_mongodb2-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "1bb9a656341c580708d02d86625aeece", "sha256": "80751f59ece3d4e0c5574f79f0a34393e98ee83cb968b2f357b9414c8b6dff0e" }, "downloads": -1, "filename": "pyramid_mongodb2-1.2.tar.gz", "has_sig": false, "md5_digest": "1bb9a656341c580708d02d86625aeece", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2278, "upload_time": "2018-07-26T04:18:17", "url": "https://files.pythonhosted.org/packages/e6/38/3a5075997691af4e5d7e53f5c051104ac61444793076ad67635549c76968/pyramid_mongodb2-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "58cb60e4c6e0c43ac70729cf3255a3df", "sha256": "7a425e0b95626163c7f085cf0fca5a46f01db33989a9fdb0bd58dea907dbe278" }, "downloads": -1, "filename": "pyramid_mongodb2-1.3.tar.gz", "has_sig": false, "md5_digest": "58cb60e4c6e0c43ac70729cf3255a3df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2322, "upload_time": "2018-07-27T01:28:20", "url": "https://files.pythonhosted.org/packages/31/98/1e9494cc20b3b38a273cca553013a13db232b02a993fda1e53cd148e6041/pyramid_mongodb2-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "fb0da5ee6936f0cc78e0e8f577c3e24f", "sha256": "7e7830a7e0f42b927acdfe3482d90fa975c335cab6a7de8836d31057b1f1bc37" }, "downloads": -1, "filename": "pyramid_mongodb2-1.4.tar.gz", "has_sig": false, "md5_digest": "fb0da5ee6936f0cc78e0e8f577c3e24f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2343, "upload_time": "2018-07-27T01:31:14", "url": "https://files.pythonhosted.org/packages/fc/3b/75b9011b83b6e065c617196423fa2f4bba4a9c8287936d6b1d13f8213e03/pyramid_mongodb2-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "d81d6f138c5bd7ef0dce0fb04e8d9e0c", "sha256": "768265d3bc46634ade1bf37b9cfd97e930c41bf9126921bfa17088a905900c0f" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.tar.gz", "has_sig": false, "md5_digest": "d81d6f138c5bd7ef0dce0fb04e8d9e0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2348, "upload_time": "2018-07-27T01:37:39", "url": "https://files.pythonhosted.org/packages/8b/a9/fd97c63fcd938c03f3487dd72084387b5daceb88d242bcc73b85938eb942/pyramid_mongodb2-1.5.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "17b089e7d8e2635547c221199df5bca7", "sha256": "cde2a1258be2e2c85e68416472ef5488904f0c21dee24879f6dc5358b0b6729d" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.1.tar.gz", "has_sig": false, "md5_digest": "17b089e7d8e2635547c221199df5bca7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2408, "upload_time": "2018-07-27T01:41:55", "url": "https://files.pythonhosted.org/packages/60/1f/606e1e3956dd1c67ec09ecaa36764b8f8c014d04f4826c4ae519899bd998/pyramid_mongodb2-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "e4af0ed77ebe68a4374abd06712d594c", "sha256": "4529497be49ac414aeba3507418e11a45499f634c363504c87412bacaf2a2bc7" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.2.tar.gz", "has_sig": false, "md5_digest": "e4af0ed77ebe68a4374abd06712d594c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2420, "upload_time": "2018-07-27T01:58:36", "url": "https://files.pythonhosted.org/packages/57/02/8de934501706f7fa90e99187f680733092535b913007693e5d7d793d1994/pyramid_mongodb2-1.5.2.tar.gz" } ], "1.5.3": [ { "comment_text": "", "digests": { "md5": "2c65b9a674346aefb7d61ddbb5f799bf", "sha256": "1e2515920fc8eaa6e085aaa7fe0bf5c4ae9b6df76661ba30a8ee60e55093f425" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.3.tar.gz", "has_sig": false, "md5_digest": "2c65b9a674346aefb7d61ddbb5f799bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2408, "upload_time": "2018-07-27T02:01:48", "url": "https://files.pythonhosted.org/packages/8e/f0/89472951fe9fa80ab38a2fff8033669c493a575300a991d5db4e4328c0bf/pyramid_mongodb2-1.5.3.tar.gz" } ], "1.5.4": [ { "comment_text": "", "digests": { "md5": "15823484429acd5b12e2aed9ddd658f4", "sha256": "093e3fd1c6ec3bc3d31bcfe16e82d1949b6a08fb86282ad2cc5f9c4080eda9c2" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.4.tar.gz", "has_sig": false, "md5_digest": "15823484429acd5b12e2aed9ddd658f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2517, "upload_time": "2018-07-27T03:31:28", "url": "https://files.pythonhosted.org/packages/c3/03/f88b88385cca1002e442393df38e0de6d5fb6c72f438d9abf2e773184a7c/pyramid_mongodb2-1.5.4.tar.gz" } ], "1.5.5": [ { "comment_text": "", "digests": { "md5": "87e93fdb1b97cdfcaf5f9cae1fe7011d", "sha256": "48bd0bce0f90a63b86d923c6a202f524c08c12d79258bf240ed8587a1addddde" }, "downloads": -1, "filename": "pyramid_mongodb2-1.5.5.tar.gz", "has_sig": false, "md5_digest": "87e93fdb1b97cdfcaf5f9cae1fe7011d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2667, "upload_time": "2018-07-27T06:33:23", "url": "https://files.pythonhosted.org/packages/ed/83/e0164c652866df101167ba6297114204b2a35d42a4a7f1c7adc5eafc370d/pyramid_mongodb2-1.5.5.tar.gz" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "f49e7d37867f4c1099e870dafe5cb3e9", "sha256": "83e7d4dac419b8df0362249adf9e0101f2b97d93f148034793d81caa392dc072" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.1.tar.gz", "has_sig": false, "md5_digest": "f49e7d37867f4c1099e870dafe5cb3e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3394, "upload_time": "2018-07-30T02:07:29", "url": "https://files.pythonhosted.org/packages/4b/38/90cf10a7f05772e858c542fdc20f456b8d7307eac7040ab292f48ce241e3/pyramid_mongodb2-1.6.1.tar.gz" } ], "1.6.2": [ { "comment_text": "", "digests": { "md5": "7e84be3ac0d4d8cc51c2ca06565d135a", "sha256": "c9a99202b67aaee44ba83413080012706597d6166386ead5cb46727e70cec1c9" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7e84be3ac0d4d8cc51c2ca06565d135a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2995, "upload_time": "2019-10-08T13:27:37", "url": "https://files.pythonhosted.org/packages/1c/4b/98e6b437d8f15f13b373655c8a32511a90308b1533d9c9925bf41ea1823c/pyramid_mongodb2-1.6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a0395dd30524a59dadfb1714d2076d2", "sha256": "58ce3bc34ba358a17896a232012e7125104e740bc4b8cf277cc0f861b4a2806c" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.2.tar.gz", "has_sig": false, "md5_digest": "7a0395dd30524a59dadfb1714d2076d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4709, "upload_time": "2018-07-31T01:32:06", "url": "https://files.pythonhosted.org/packages/90/81/d37d070a238126db30b2a566e16745f5948b28cceefd234fd3a9a7890af9/pyramid_mongodb2-1.6.2.tar.gz" } ], "1.6.4": [ { "comment_text": "", "digests": { "md5": "ac93b1341346a94545bc28b6501ef328", "sha256": "b864ee39b8e944d68e28e6947e0f548abad3e6df7acb1a87a9e3710fb129ad6a" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ac93b1341346a94545bc28b6501ef328", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2989, "upload_time": "2019-10-08T13:53:38", "url": "https://files.pythonhosted.org/packages/83/65/c66fd9d84ba03d70aa1eeb4b6ca46ea975f7ce86eb8523b68728f134c811/pyramid_mongodb2-1.6.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d62f031b257eec6878e77d8601050841", "sha256": "344bb7fb3073ad6aec505199c781b828f6eb44e43ca160a7619a0f710d4fcb20" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.4.tar.gz", "has_sig": false, "md5_digest": "d62f031b257eec6878e77d8601050841", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2019-10-08T13:52:46", "url": "https://files.pythonhosted.org/packages/32/4d/5f1cd8520789ddb5ff004da87ff5873ce175d70c4c7c5ad17e7d1d85f5b3/pyramid_mongodb2-1.6.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac93b1341346a94545bc28b6501ef328", "sha256": "b864ee39b8e944d68e28e6947e0f548abad3e6df7acb1a87a9e3710fb129ad6a" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ac93b1341346a94545bc28b6501ef328", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2989, "upload_time": "2019-10-08T13:53:38", "url": "https://files.pythonhosted.org/packages/83/65/c66fd9d84ba03d70aa1eeb4b6ca46ea975f7ce86eb8523b68728f134c811/pyramid_mongodb2-1.6.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d62f031b257eec6878e77d8601050841", "sha256": "344bb7fb3073ad6aec505199c781b828f6eb44e43ca160a7619a0f710d4fcb20" }, "downloads": -1, "filename": "pyramid_mongodb2-1.6.4.tar.gz", "has_sig": false, "md5_digest": "d62f031b257eec6878e77d8601050841", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2019-10-08T13:52:46", "url": "https://files.pythonhosted.org/packages/32/4d/5f1cd8520789ddb5ff004da87ff5873ce175d70c4c7c5ad17e7d1d85f5b3/pyramid_mongodb2-1.6.4.tar.gz" } ] }