rack


Namerack JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryPersistent data structures mimicking as Python native containers
upload_time2024-06-11 20:31:47
maintainerNone
docs_urlNone
authorJérôme Carretero
requires_pythonNone
licenseMIT License Copyright (c) <year> <copyright holders> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords persistent
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #########################
Rack, another shelve-like
#########################


Rack contains `PersistentSet` and `PersistentDict`
classes that can be used to store data using set/dict semantics,
while having contents persisted to mass storage.

This library can be used when you want to use sets or mappings that
may be too big to fit in RAM, or you want them to be persisted to disk,
either online (as they're used) or once (to load/save data).

It uses LMDB or SQLite3 as underlying engine:

- LMDB is a tiny in-process "NoSQL" database which is very fast.

- SQLite3 is a small in-process SQL database which stores data in
  single files, with a well-defined on-disk layout, and is rather
  space-efficient.

Contents are serialized from / deserialized to Python native objects
on access, so the structures are obviously slower than in-memory
counterparts.


Usage
#####

Use `rack.set*.PersistentSet` as you would use a `set`,
and `rack.dict*.PersistentDict` as you would use a `dict`,
except that:

- On construction:

  - They need to take a `name` argument indicating the
    (prefix to the) location of the underlying LMDB database.

  - For LMDB, they can take a `hash` argument if you want to specify
    a non-default hasher (default is SHA256).

  - They can take a `serdes` argument which you can use to specify
    a non-default serializer/deserializer (default is Python's
    marshal).

- On use:

  - They must be used with a context manager, which is required
    in order to properly manage the lifetime of the database open/close,
    as `__init__` / `__del__` would not be sufficient due to the
    garbage collected nature of Python.

  - Operations that create a new container (eg. union, copy),
    take an optional name parameter, which allows to specify the
    location of the new database.

If you know you store elements of limited size (less than LMDB max key
size), you can use `rack.set_small.PersistentSet`, which is ~2x faster
than the non-small one due to one less indirection. If keys are too
big, `lmdb.BadValsizeError` exceptions will occur.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rack",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "persistent",
    "author": "J\u00e9r\u00f4me Carretero",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9c/7e/9b902229e2b49a824de089c7f09a1a9b44613614c2abfebefa5ab32f761e/rack-0.1.4.tar.gz",
    "platform": null,
    "description": "#########################\nRack, another shelve-like\n#########################\n\n\nRack contains `PersistentSet` and `PersistentDict`\nclasses that can be used to store data using set/dict semantics,\nwhile having contents persisted to mass storage.\n\nThis library can be used when you want to use sets or mappings that\nmay be too big to fit in RAM, or you want them to be persisted to disk,\neither online (as they're used) or once (to load/save data).\n\nIt uses LMDB or SQLite3 as underlying engine:\n\n- LMDB is a tiny in-process \"NoSQL\" database which is very fast.\n\n- SQLite3 is a small in-process SQL database which stores data in\n  single files, with a well-defined on-disk layout, and is rather\n  space-efficient.\n\nContents are serialized from / deserialized to Python native objects\non access, so the structures are obviously slower than in-memory\ncounterparts.\n\n\nUsage\n#####\n\nUse `rack.set*.PersistentSet` as you would use a `set`,\nand `rack.dict*.PersistentDict` as you would use a `dict`,\nexcept that:\n\n- On construction:\n\n  - They need to take a `name` argument indicating the\n    (prefix to the) location of the underlying LMDB database.\n\n  - For LMDB, they can take a `hash` argument if you want to specify\n    a non-default hasher (default is SHA256).\n\n  - They can take a `serdes` argument which you can use to specify\n    a non-default serializer/deserializer (default is Python's\n    marshal).\n\n- On use:\n\n  - They must be used with a context manager, which is required\n    in order to properly manage the lifetime of the database open/close,\n    as `__init__` / `__del__` would not be sufficient due to the\n    garbage collected nature of Python.\n\n  - Operations that create a new container (eg. union, copy),\n    take an optional name parameter, which allows to specify the\n    location of the new database.\n\nIf you know you store elements of limited size (less than LMDB max key\nsize), you can use `rack.set_small.PersistentSet`, which is ~2x faster\nthan the non-small one due to one less indirection. If keys are too\nbig, `lmdb.BadValsizeError` exceptions will occur.\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) <year> <copyright holders>  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Persistent data structures mimicking as Python native containers",
    "version": "0.1.4",
    "project_urls": {
        "Download": "https://pypi.python.org/pypi/rack",
        "Homepage": "https://gitlab.com/cJ/rack"
    },
    "split_keywords": [
        "persistent"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf30e8ff05ea755f9140c22539d30728597052587798f0e0a1673e31923f9ca6",
                "md5": "709708d7de9395716a5dd9dd77b1d79f",
                "sha256": "ce86e01c072588c549a6623155d5c8ad1eca739ce3f32814c35d37c22ca39eb9"
            },
            "downloads": -1,
            "filename": "rack-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "709708d7de9395716a5dd9dd77b1d79f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10075,
            "upload_time": "2024-06-11T20:31:46",
            "upload_time_iso_8601": "2024-06-11T20:31:46.410562Z",
            "url": "https://files.pythonhosted.org/packages/bf/30/e8ff05ea755f9140c22539d30728597052587798f0e0a1673e31923f9ca6/rack-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c7e9b902229e2b49a824de089c7f09a1a9b44613614c2abfebefa5ab32f761e",
                "md5": "e0b806ef2b71bcf07b265764df48c6f5",
                "sha256": "41a5a6393b65767c4a3432331808d04613a2ef41ef005eb7de50ea9883dc2a70"
            },
            "downloads": -1,
            "filename": "rack-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e0b806ef2b71bcf07b265764df48c6f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9909,
            "upload_time": "2024-06-11T20:31:47",
            "upload_time_iso_8601": "2024-06-11T20:31:47.799091Z",
            "url": "https://files.pythonhosted.org/packages/9c/7e/9b902229e2b49a824de089c7f09a1a9b44613614c2abfebefa5ab32f761e/rack-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 20:31:47",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "cJ",
    "gitlab_project": "rack",
    "lcname": "rack"
}
        
Elapsed time: 0.26802s