{ "info": { "author": "thegrymek", "author_email": "andrzej.grymkowski@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=======================\nPython Disk Collections\n=======================\n\n.. image:: https://img.shields.io/pypi/v/python-disk-collections.svg\n :target: https://pypi.python.org/pypi/python-disk-collections\n\n.. image:: https://img.shields.io/pypi/l/python-disk-collections.svg\n :target: https://pypi.python.org/pypi/python-disk-collections\n\n.. image:: https://img.shields.io/pypi/pyversions/python-disk-collections.svg\n :target: https://pypi.python.org/pypi/python-disk-collections\n\n.. image:: https://travis-ci.org/thegrymek/python-disk-collections.svg?branch=master\n :target: https://travis-ci.org/thegrymek/python-disk-collections\n\n.. image:: https://coveralls.io/repos/github/thegrymek/python-disk-collections/badge.svg\n :target: https://coveralls.io/github/thegrymek/python-disk-collections\n\n\nModule contains class with extended python list that stores items at disk.\nBy default items before save are pickled and compressed. Use that list\nas usual list!\n\nIn addition, there is implemented extended python deque with disk storage and\nsame behaviour as **collections.deque**.\n\nIntend of package was to create generic iterables that stores really big collection of items\nthat does not fit in memory and to avoid usage of external cache and local database\nstorages.\n\n\n.. code-block:: python\n\n >>> from diskcollections.iterables import FileList\n >>> flist = FileList()\n >>> flist.extend([1, 2, 3])\n >>> flist.append(4)\n >>> flist\n [1, 2, 3, 4]\n >>> flist[2]\n 3\n >>> flist2 = flist[:] # copy makes new FileList\n >>> my_list = list(flist) # now its simple list\n\n\n.. code-block:: python\n\n >>> from diskcollections.iterables import FileDeque\n >>> fdeque = FileDeque()\n >>> fdeque.extend([1, 2, 3])\n >>> fdeque.append(4)\n >>> fdeque\n FileDeque([1, 2, 3, 4])\n >>> fdeque.pop()\n 4\n >>> fdeque.appendleft(0)\n >>> fdeque.popleft()\n 0\n\n\nThere are available more ways to serialize items.\n\n\n.. code-block:: python\n\n >>> from diskcollections.iterables import FileList, FileDeque\n >>> from diskcollections.serializers import (\n PickleSerializer, # pickle items\n PickleZLibSerializer, # pickle + compress items\n JsonSerializer, # convert to json items\n JsonZLibSerializer # convert to json + compress items\n )\n >>> from functools import partial\n >>> JsonFileList = partial(FileList, serializer_class=JsonHandler)\n >>> flist = JsonFileList()\n >>> flist.append({'a': 1, 'b': 2, 'c': 3})\n >>> flist[0]\n {u'a': 1, u'b': 2, u'c': 3}\n\n\nInstallation\n------------\n\nTo install package type\n\n.. code-block:: bash\n\n $ pip install python-disk-collections\n\n\nHow it works\n------------\n\nIn order to implement your serializer create class with methods:\n**dumps** and **loads** or import interface.\n\n\n.. code-block:: python\n\n >>> from diskcollections.interfaces import ISerializer\n\n class ISerializer:\n\n @staticmethod\n def dumps(obj):\n \"\"\"Converts object to string.\n\n :param obj: any python object\n :return: dumped string\n \"\"\"\n raise NotImplementedError\n\n @staticmethod\n def loads(obj):\n \"\"\"Restored dumped string into python object.\n\n :param obj: Object stored as string\n :return: python object restored from dump\n \"\"\"\n raise NotImplementedError\n\nAll serializers from example above implements interface **ISerializer**.\n\nUnder the hood, **FileList** for storage items uses *tempfile.mktemp* (in python2)\nor *tempfile.TemporaryDirectory* (in python3). It means, that every list\nhas own unique directory, placed likely in */tmp/*.\nWhen list is removed by garbage collector, all items that was stored are lost.\n\nFor **FileDeque** stores items in the same way as **FileList**.\n\n\nContribute\n----------\n\n#. Fork repository on GitHub to start making your changes to the **master** branch (or branch off of it).\n#. Write tests that prove that bug or future works as expected\n#. Check your code and tests with **tox**\n#. Send a pull request!\n\n\nLicense\n-------\n\nPython-Disk-Collection is under MIT license, see LICENSE for more details.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/thegrymek/python-disk-collections/archive/0.0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thegrymek/python-disk-collections", "keywords": "pickle,cache,collections,list,deque,json,zlib,disk", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-disk-collections", "package_url": "https://pypi.org/project/python-disk-collections/", "platform": "", "project_url": "https://pypi.org/project/python-disk-collections/", "project_urls": { "Download": "https://github.com/thegrymek/python-disk-collections/archive/0.0.3.tar.gz", "Homepage": "https://github.com/thegrymek/python-disk-collections" }, "release_url": "https://pypi.org/project/python-disk-collections/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Package provides classes: FileList, FileDeque that behaves like bulltins but keeps items at disk.", "version": "0.0.3" }, "last_serial": 5633858, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2b5d220b438fcdc81a5224ef76e4849e", "sha256": "5f7295155462cb28a8ad927b7d5ca115895ea02e9b6ecc2c5aeb23f6b6f54149" }, "downloads": -1, "filename": "python_disk_collections-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2b5d220b438fcdc81a5224ef76e4849e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13553, "upload_time": "2017-11-01T23:41:55", "url": "https://files.pythonhosted.org/packages/d0/6d/78defe65a7ab75beddfdae405feaba5746f0644c170b0b528366d996bd16/python_disk_collections-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "841e8f990b4aea38ee82f8267e0d9633", "sha256": "caaa686675212a0a97d8c48d67d0a1ae2fd862c0c8774b42d32c354be7da6132" }, "downloads": -1, "filename": "python-disk-collections-0.0.1.tar.gz", "has_sig": false, "md5_digest": "841e8f990b4aea38ee82f8267e0d9633", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8010, "upload_time": "2017-11-01T23:41:56", "url": "https://files.pythonhosted.org/packages/4a/18/354a1318607b8f454c868b927f56b0c1b41f6b967b40c33df7060b14fdab/python-disk-collections-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "21c3722caf7fc7f9bd416829d0ddc9c7", "sha256": "5fa03991d49d5649d702896a172ad97b22b83174e3325183d402407d18c73c85" }, "downloads": -1, "filename": "python_disk_collections-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "21c3722caf7fc7f9bd416829d0ddc9c7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14886, "upload_time": "2017-11-18T21:46:43", "url": "https://files.pythonhosted.org/packages/79/b6/8d93bc9750969a59f90a13df819b64c9e7adf527d8e0814dac3a906d4038/python_disk_collections-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d070cf5f72f861d1a0fa163311a1115b", "sha256": "220f26c8fc68a828472e7b1884d0cd16060b3ca297e55bf7b3c940e113b190ae" }, "downloads": -1, "filename": "python-disk-collections-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d070cf5f72f861d1a0fa163311a1115b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9809, "upload_time": "2017-11-18T21:46:45", "url": "https://files.pythonhosted.org/packages/60/e5/cd2801335e23938d44cb7a656e5417051c94f472225304b74d9b7b91e04e/python-disk-collections-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c8a1907404e33c68476f3437c14f9da3", "sha256": "ce307359226f8f04b9e99673b39e48430f5919eb7d298b7badc509f702f17e44" }, "downloads": -1, "filename": "python_disk_collections-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c8a1907404e33c68476f3437c14f9da3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10689, "upload_time": "2019-08-05T11:57:37", "url": "https://files.pythonhosted.org/packages/b2/53/b30d0eef98d63762b94bbd68d3e2bc04bff865d679a6cbc80d66c9e74d8d/python_disk_collections-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7ebcbc653e9522209ee9ab256fb87e2", "sha256": "f982c2a2d3ae4fa061249fa4c6c452ed9841acfe925befd653d774777d80eff6" }, "downloads": -1, "filename": "python-disk-collections-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a7ebcbc653e9522209ee9ab256fb87e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8939, "upload_time": "2019-08-05T11:57:38", "url": "https://files.pythonhosted.org/packages/b9/71/0cbeed527ee3f9a764ae0c285ce65a3ef9eb80a189ead10d39590eeae7c8/python-disk-collections-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8a1907404e33c68476f3437c14f9da3", "sha256": "ce307359226f8f04b9e99673b39e48430f5919eb7d298b7badc509f702f17e44" }, "downloads": -1, "filename": "python_disk_collections-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c8a1907404e33c68476f3437c14f9da3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10689, "upload_time": "2019-08-05T11:57:37", "url": "https://files.pythonhosted.org/packages/b2/53/b30d0eef98d63762b94bbd68d3e2bc04bff865d679a6cbc80d66c9e74d8d/python_disk_collections-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7ebcbc653e9522209ee9ab256fb87e2", "sha256": "f982c2a2d3ae4fa061249fa4c6c452ed9841acfe925befd653d774777d80eff6" }, "downloads": -1, "filename": "python-disk-collections-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a7ebcbc653e9522209ee9ab256fb87e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8939, "upload_time": "2019-08-05T11:57:38", "url": "https://files.pythonhosted.org/packages/b9/71/0cbeed527ee3f9a764ae0c285ce65a3ef9eb80a189ead10d39590eeae7c8/python-disk-collections-0.0.3.tar.gz" } ] }