{ "info": { "author": "Sanhe Hu", "author_email": "husanhe@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://travis-ci.org/MacHu-GWU/mongomock_mate-project.svg?branch=master\n :target: https://travis-ci.org/MacHu-GWU/mongomock_mate-project?branch=master\n\n.. image:: https://codecov.io/gh/MacHu-GWU/mongomock_mate-project/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/MacHu-GWU/mongomock_mate-project\n\n.. image:: https://img.shields.io/pypi/v/mongomock_mate.svg\n :target: https://pypi.python.org/pypi/mongomock_mate\n\n.. image:: https://img.shields.io/pypi/l/mongomock_mate.svg\n :target: https://pypi.python.org/pypi/mongomock_mate\n\n.. image:: https://img.shields.io/pypi/pyversions/mongomock_mate.svg\n :target: https://pypi.python.org/pypi/mongomock_mate\n\n.. image:: https://img.shields.io/badge/Star_Me_on_GitHub!--None.svg?style=social\n :target: https://github.com/MacHu-GWU/mongomock_mate-project\n\n\nWelcome to ``mongomock_mate`` Documentation\n==============================================================================\n\n**Use** ``mongomock_mate``:\n\nJust import ``mongomock_mate`` at begin of your script. It use monkey patch:\n\n.. code-block:: python\n\n import mongomock_mate\n\n\n**Features**:\n\n**Data Persistence: dump and load data**\n\n.. code-block:: python\n\n import mongomock_mate\n\n # dump\n db = client[\"test\"]\n c_user = db[\"user\"]\n\n c_user.insert([{\"_id\": 1, \"name\": \"Alice\"}, {\"_id\": 2, \"name\": \"Bob\"}])\n\n db.dump_db(\"test.json\")\n\n # load\n db = client[\"test\"]\n db.load_db(\"test.json\")\n\n # other params\n def dump_db(self, file,\n pretty=False,\n overwrite=False,\n verbose=True):\n \"\"\"\n Dump :class:`mongomock.database.Database` to a local file. Only support\n ``*.json`` or ``*.gz`` (compressed json file)\n\n :param file: file path.\n :param pretty: bool, toggle on jsonize into pretty format.\n :param overwrite: bool, allow overwrite to existing file.\n :param verbose: bool, toggle on log.\n \"\"\"\n\n def load_db(self, file, check_dbname=True, verbose=True):\n \"\"\"\n Load :class:`mongomock.database.Database` from a local file.\n\n :param file: file path.\n :param check_dbname: bool, if True, the dbname has to be matched.\n :param verbose: bool, toggle on log.\n \"\"\"\n\n\n**Working with mongoengine ORM:**\n\n2018-07-30:\n\nAt mongomock==3.10.0, insert operation doesn't work with latest mongoengine==0.15.3, because the implementation of ``WriteConcern`` is not correct in mongomock.\n\n`Github Issue `_.\n\n.. code-block:: python\n\n import mongomock_mate\n from mongoengine import connect, Document, fields\n\n connect('mongoenginetest', host='mongomock://localhost')\n\n class User(Document):\n _id = fields.IntField(primary_key=True)\n name = fields.StringField()\n\n User.objects.insert(User(_id=1, name=\"Alice\"))\n\n\nQuick Links\n------------------------------------------------------------------------------\n- .. image:: https://img.shields.io/badge/Link-Document-red.svg\n :target: https://mongomock_mate.readthedocs.io/index.html\n\n- .. image:: https://img.shields.io/badge/Link-API_Reference_and_Source_Code-red.svg\n :target: https://mongomock_mate.readthedocs.io/py-modindex.html\n\n- .. image:: https://img.shields.io/badge/Link-Install-red.svg\n :target: `install`_\n\n- .. image:: https://img.shields.io/badge/Link-GitHub-blue.svg\n :target: https://github.com/MacHu-GWU/mongomock_mate-project\n\n- .. image:: https://img.shields.io/badge/Link-Submit_Issue_and_Feature_Request-blue.svg\n :target: https://github.com/MacHu-GWU/mongomock_mate-project/issues\n\n- .. image:: https://img.shields.io/badge/Link-Download-blue.svg\n :target: https://pypi.python.org/pypi/mongomock_mate#downloads\n\n\n.. _install:\n\nInstall\n------------------------------------------------------------------------------\n\n``mongomock_mate`` is released on PyPI, so all you need is:\n\n.. code-block:: console\n\n $ pip install mongomock_mate\n\nTo upgrade to latest version:\n\n.. code-block:: console\n\n $ pip install --upgrade mongomock_mate\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://pypi.python.org/pypi/mongomock_mate/0.0.1#downloads", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MacHu-GWU/", "keywords": "", "license": "MIT", "maintainer": "Sanhe Hu", "maintainer_email": "husanhe@gmail.com", "name": "mongomock-mate", "package_url": "https://pypi.org/project/mongomock-mate/", "platform": "Windows", "project_url": "https://pypi.org/project/mongomock-mate/", "project_urls": { "Download": "https://pypi.python.org/pypi/mongomock_mate/0.0.1#downloads", "Homepage": "https://github.com/MacHu-GWU/" }, "release_url": "https://pypi.org/project/mongomock-mate/0.0.1/", "requires_dist": [ "pymongo", "mongoengine", "mongomock", "superjson" ], "requires_python": "", "summary": "Add additional feature for mongomock.", "version": "0.0.1" }, "last_serial": 4118653, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b7a0f26ccf0fb112c40abf5be8022805", "sha256": "445fc674381a5435966a3fb0fbeb6463f189ee171af384f99ff76b505e956038" }, "downloads": -1, "filename": "mongomock_mate-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b7a0f26ccf0fb112c40abf5be8022805", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24941, "upload_time": "2018-07-31T03:18:05", "url": "https://files.pythonhosted.org/packages/66/55/2377f516c3d9365c6e66a19bfbf88a9b6a34f4ea06b092d11d7e3814684c/mongomock_mate-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2dc5839a5d7448bbf1632cc158ec6fc", "sha256": "0b55f54f2fa131290ac4251d05306a2599c6829d23682706ed93aba4d9597b0a" }, "downloads": -1, "filename": "mongomock_mate-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e2dc5839a5d7448bbf1632cc158ec6fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14771, "upload_time": "2018-07-31T03:18:06", "url": "https://files.pythonhosted.org/packages/2f/fb/cd39929a176990af81f5d433c4b8fc403127903ce019370712ef100f47b1/mongomock_mate-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b7a0f26ccf0fb112c40abf5be8022805", "sha256": "445fc674381a5435966a3fb0fbeb6463f189ee171af384f99ff76b505e956038" }, "downloads": -1, "filename": "mongomock_mate-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "b7a0f26ccf0fb112c40abf5be8022805", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 24941, "upload_time": "2018-07-31T03:18:05", "url": "https://files.pythonhosted.org/packages/66/55/2377f516c3d9365c6e66a19bfbf88a9b6a34f4ea06b092d11d7e3814684c/mongomock_mate-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2dc5839a5d7448bbf1632cc158ec6fc", "sha256": "0b55f54f2fa131290ac4251d05306a2599c6829d23682706ed93aba4d9597b0a" }, "downloads": -1, "filename": "mongomock_mate-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e2dc5839a5d7448bbf1632cc158ec6fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14771, "upload_time": "2018-07-31T03:18:06", "url": "https://files.pythonhosted.org/packages/2f/fb/cd39929a176990af81f5d433c4b8fc403127903ce019370712ef100f47b1/mongomock_mate-0.0.1.tar.gz" } ] }