{ "info": { "author": "Martin P. Hellwig", "author_email": "martin.hellwig@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": ".. image:: https://img.shields.io/codeship/a9873030-5c43-0134-5e91-46e8172ca5a4/default.svg\n :target: https://bitbucket.org/hellwig/django-memdb\n.. image:: https://coveralls.io/repos/bitbucket/hellwig/django-memdb/badge.svg?branch=default \n :target: https://coveralls.io/bitbucket/hellwig/django-memdb?branch=default\n.. image:: https://img.shields.io/pypi/v/django-memdb.svg\n :target: https://pypi.python.org/pypi/Django-MemDB/\n.. image:: https://img.shields.io/badge/Donate-PayPal-blue.svg\n :target: https://paypal.me/MartinHellwig\n.. image:: https://img.shields.io/badge/Donate-Patreon-orange.svg\n :target: https://www.patreon.com/hellwig\n \n\n######################\nDjango Memory Database\n######################\n\nWhat is it?\n===========\nA library that allows tables to be kept in an in-memory database and optionally\ncan provide persistence between instance restart by spooling the tables to a\ntable that is read upon startup to populate the in-memory tables. \n\nWhat problem does it solve?\n===========================\nCreate in-memory tables with optional data persistence. \n\nHow do I install it?\n====================\n.. sourcecode:: shell\n\n pip install django-memdb\n\n\nAdding to Django (using integrator)\n-----------------------------------\n.. sourcecode:: python\n\n # At the bottom of your settings.py file.\n import django_integrator\n django_integrator.add_application('django_memdb')\n\nIf you don't want to use the above, add the application to INSTALLED_APPS and\nmerge the apps settings.py and url.py into the django projects files. \n\nHow do I use it?\n================\nWhen defining models, use the class mixin.\n\nFor example:\n\n.. sourcecode:: python\n\n from django.db import models\n from django_memdb.mixins import InMemoryDB, PeristentInMemoryDB\n \n class TestModelWithMixin(models.Model, InMemoryDB):\n text = models.TextField()\n \n class TestModelPersistent(models.Model, PeristentInMemoryDB):\n text = models.TextField()\n\n\nBoth mixins work more like a tag, which is used to determine if a table is an\nin-memory table or not and if the table contents should be stored in the\n(using the default database) PersistentStorage model.\n\nYou can optionally hook into the persistentstorage mechanics by attaching to the\nsignals this app provides. The below example will add compression the data\nbefore storing it:\n\n.. sourcecode:: python\n\n\tfrom django_memdb import signals\n\t\n\tdef compress(arguments):\n\t \"Compress data.\"\n\t # pylint: disable=redefined-variable-type\n\t if arguments['process'] == settings.MEMDB_PROCESS_ENCODE:\n\t data = arguments['data']\n\t data = json.dumps(data)\n\t data = data.encode('utf-8')\n\t data = zlib.compress(data)\n\t arguments['data'] = data\n\t elif arguments['process'] == settings.MEMDB_PROCESS_DECODE:\n\t data = arguments['data']\n\t data = zlib.decompress(data)\n\t data = data.decode('utf-8')\n\t data = json.loads(data)\n\t arguments['data'] = data\n\t\n\tdef callback(sender, **kwargs): # pylint: disable=unused-argument\n\t \"Just insert a hook.\"\n\t kwargs['kwargs']['processors'].append(compress)\n\t\n\t\n\tsignals.store_save.connect(callback)\n\tsignals.store_load.connect(callback)\n\n\nCaveat\n======\nThe in memory database is local to each server instance, thus if you have a\nsetup that uses multiple servers and a single django database instance, you will\nhave synchronisation issues with the in-memory data and hard conflicts when\nusing the persistent storage.\n\nWhat license is this?\n=====================\nTwo-clause BSD\n\n\nHow can I get support?\n======================\nPlease use the repo's bug tracker to leave behind any questions, feedback,\nsuggestions and comments. I will handle them depending on my time and what looks\ninteresting. If you require guaranteed support please contact me via\ne-mail so we can discuss appropriate compensation.\n\n\nSigning Off\n===========\nIs my work helpful or valuable to you? You can repay me by donating via:\n\nhttps://paypal.me/MartinHellwig\n\n.. image:: https://img.shields.io/badge/PayPal-MartinHellwig-blue.svg\n :target: https://paypal.me/MartinHellwig\n :alt: Donate via PayPal.Me\n :scale: 120 %\n\n-or-\n\nhttps://www.patreon.com/hellwig\n\n.. image:: https://img.shields.io/badge/Patreon-hellwig-orange.svg\n :target: https://www.patreon.com/hellwig\n :alt: Donate via Patreon\n :scale: 120 %\n\n\nThank you!", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/hellwig/django-memdb/download/0.0.6.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/hellwig/django-memdb/", "keywords": "django,django-integrator", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-memdb", "package_url": "https://pypi.org/project/django-memdb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-memdb/", "project_urls": { "Download": "https://bitbucket.org/hellwig/django-memdb/download/0.0.6.zip", "Homepage": "https://bitbucket.org/hellwig/django-memdb/" }, "release_url": "https://pypi.org/project/django-memdb/0.0.6/", "requires_dist": null, "requires_python": null, "summary": "Django Memory Database", "version": "0.0.6" }, "last_serial": 2349754, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "61ef0c65cbd2484423e95e046aa14466", "sha256": "7130146dfc60cc25803317a42f3802743e58b4c134b3987c266bd2781e1e66ee" }, "downloads": -1, "filename": "django-memdb-0.0.1.tar.gz", "has_sig": false, "md5_digest": "61ef0c65cbd2484423e95e046aa14466", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7630, "upload_time": "2016-09-14T01:01:22", "url": "https://files.pythonhosted.org/packages/f3/50/39b12623dafe897bff67acf1271f75ef29f4f5c0df60f9ab3b7a387adbaf/django-memdb-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "92ffaf9ad22b849bf50fb674fcb50b12", "sha256": "abb6d6d2cd47fba083f5e1fb05844f9e252987a2146c6d7b370bfa1a3e735798" }, "downloads": -1, "filename": "django-memdb-0.0.2.tar.gz", "has_sig": false, "md5_digest": "92ffaf9ad22b849bf50fb674fcb50b12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9150, "upload_time": "2016-09-14T08:56:01", "url": "https://files.pythonhosted.org/packages/27/b7/6a3406a9f34168c9a123ef4a145f83b2156ce0c68a80fadaff303d1b2357/django-memdb-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "46ff1f802a056547aca06ce47e876355", "sha256": "85a1522443b52aa648c39a532ac085b9f00b2ebfeb4afc4c2583a6ace4d1b07c" }, "downloads": -1, "filename": "django-memdb-0.0.3.tar.gz", "has_sig": false, "md5_digest": "46ff1f802a056547aca06ce47e876355", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9132, "upload_time": "2016-09-14T09:01:12", "url": "https://files.pythonhosted.org/packages/43/fe/7a831e9f429b4113940b945b4099a148867929f91f827dd0a5764a439690/django-memdb-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4c5be7e0610af69a8220e94c2cdedf46", "sha256": "fc292deccec439db74132a7fb534d5b1e709077814946106e304187e5c880d25" }, "downloads": -1, "filename": "django-memdb-0.0.4.tar.gz", "has_sig": false, "md5_digest": "4c5be7e0610af69a8220e94c2cdedf46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9126, "upload_time": "2016-09-14T20:05:53", "url": "https://files.pythonhosted.org/packages/f7/1f/eceb0b43e90d4052dbf621b5cf62d56dde723b4a62b87d8c44639525638c/django-memdb-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "584dfb2d6975c3a5b8469e6b63833375", "sha256": "9969999e0d8d3b0c5c13e6cbf22fd544e1e25232f2920467e5c0e5ea66378282" }, "downloads": -1, "filename": "django-memdb-0.0.5.tar.gz", "has_sig": false, "md5_digest": "584dfb2d6975c3a5b8469e6b63833375", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9256, "upload_time": "2016-09-14T20:37:47", "url": "https://files.pythonhosted.org/packages/33/39/c0fe7b442fa99a9fc053d3d44899902905f483d27db9364536d529e45ccb/django-memdb-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "9e8843e64a77434d8b17d94f06f72f5d", "sha256": "3d1943387dce3058dda7cc52752dfa6e043a64a6949d64ea6ae9b91cc9696cad" }, "downloads": -1, "filename": "django-memdb-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9e8843e64a77434d8b17d94f06f72f5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9262, "upload_time": "2016-09-18T23:50:23", "url": "https://files.pythonhosted.org/packages/df/df/b9a1ca5a05a6a95f527899f5c96e546270a342ba696978b72e63fe24f364/django-memdb-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e8843e64a77434d8b17d94f06f72f5d", "sha256": "3d1943387dce3058dda7cc52752dfa6e043a64a6949d64ea6ae9b91cc9696cad" }, "downloads": -1, "filename": "django-memdb-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9e8843e64a77434d8b17d94f06f72f5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9262, "upload_time": "2016-09-18T23:50:23", "url": "https://files.pythonhosted.org/packages/df/df/b9a1ca5a05a6a95f527899f5c96e546270a342ba696978b72e63fe24f364/django-memdb-0.0.6.tar.gz" } ] }