{ "info": { "author": "Lujeni", "author_email": "julien@thebault.co", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: Unix", "Programming Language :: Python :: 2.7" ], "description": "LeakDB\n======\n\nWhy ?\n-----\nFor the fun \\o/\n\nOverview\n--------\nLeakDB is a very simple and fast key value store for Python.\n\nAll data is stored in memory and the persistence is defined by the user.\nA max queue size can be defined for a auto-flush.\n\nAPI\n---\n.. code:: python\n\n >>> from leakdb import PersistentQueueStorage\n >>> leak = PersistentQueueStorage(filename='/tmp/foobar.db')\n\n # set the value of a key\n >>> leak.set('bar', {'foo': 'bar'})\n >>> leak.set('foo', 2, key_prefix='bar_')\n\n # increment a key\n >>> leak.incr(key='bar_foo', delta=5)\n 7\n\n >>> leak.incr(key='foobar', initial_value=1000)\n 1000\n\n # looks up multiple keys\n >>> leak.get_multi(keys=['bar', 'foobar'])\n {u'foobar': 1000, u'bar': {u'foo': u'bar'}}\n\n # ensure changes are sent to disk\n >>> print leak\n /tmp/foobar.db 12288 bytes :: 3 items in queue :: 3 items in storage memory\n\n >>> leak.flush(force=True)\n /tmp/foobar.db 12338 bytes :: 0 items in queue :: 3 items in storage memory\n\n >>> leak.close()\n\nSTORAGE\n-------\n\n- **DefaultStorage** :: The default storage, all API operations are implemented ``set`` ``set_multi`` ``incr`` ``decr`` ``get_multi`` ``delete``\n- **QueueStorage** :: Use the ``DefaultStorage`` with a queue. You can override the ``QueueStorage.worker_process`` method and make what you want when the ``flush`` method is called.\n\n.. code:: python\n\n from leakdb import QueueStorage\n\n class MyQueueStorage(QueueStorage):\n\n def worker_process(self, item):\n \"\"\" Default action execute by each worker.\n Must return a True statement to remove the item,\n otherwise the worker put the item into the queue.\n \"\"\"\n logger.info('process item :: {}'.format(item))\n return True\n\n- **PersistentStorage** :: Use the ``DefaultStorage``, otherwise **each** operation is stored through the ``shelve`` module.\n- **PersistentQueueStorage** :: Use the ``QueueStorage`` and the ``PersistentStorage``.\n\n.. code:: python\n\n # see also the API part\n from leakdb import PersistentQueueStorage\n\n storage = PersistentQueueStorage(filename=\"/tmp/foobar.db\", maxsize=1, workers=1)\n # the queue is auto-flush, each operations check the queue size\n storage.set('foo', 1)\n\nTODO\n----\n\n- finish the transport layer through zeroMQ\n- cleanup the code\n- improves the unittests\n- write a CLI\n- benchmark each storage", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Lujeni/LeakDB", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "LeakDB", "package_url": "https://pypi.org/project/LeakDB/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/LeakDB/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Lujeni/LeakDB" }, "release_url": "https://pypi.org/project/LeakDB/0.2/", "requires_dist": null, "requires_python": null, "summary": "LeakDB is a very simple and fast key value store for Python", "version": "0.2" }, "last_serial": 1183091, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a96106516764aa027cd986ce26365a51", "sha256": "a931dfd5660da9ec5debb0af9cfacfb0092fec4be0635a92b4bad121360385c5" }, "downloads": -1, "filename": "LeakDB-0.1.tar.gz", "has_sig": false, "md5_digest": "a96106516764aa027cd986ce26365a51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4966, "upload_time": "2014-08-01T20:09:03", "url": "https://files.pythonhosted.org/packages/a7/bc/036b72766e4a84f521562e21e9a32ec791325a9ea763fed845ed2e87c168/LeakDB-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "7b5cff00669c84e2aa233150337a6125", "sha256": "8ce8c7aaa0f534afc47d5964bddf200c00ba13fcba0d46cc1140f47b7b54a131" }, "downloads": -1, "filename": "LeakDB-0.2.tar.gz", "has_sig": false, "md5_digest": "7b5cff00669c84e2aa233150337a6125", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5231, "upload_time": "2014-08-07T16:40:40", "url": "https://files.pythonhosted.org/packages/b1/7b/cf6ccbf87917785e294256b13ee40cb60715ddb272550ccc6032765f272f/LeakDB-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7b5cff00669c84e2aa233150337a6125", "sha256": "8ce8c7aaa0f534afc47d5964bddf200c00ba13fcba0d46cc1140f47b7b54a131" }, "downloads": -1, "filename": "LeakDB-0.2.tar.gz", "has_sig": false, "md5_digest": "7b5cff00669c84e2aa233150337a6125", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5231, "upload_time": "2014-08-07T16:40:40", "url": "https://files.pythonhosted.org/packages/b1/7b/cf6ccbf87917785e294256b13ee40cb60715ddb272550ccc6032765f272f/LeakDB-0.2.tar.gz" } ] }