{ "info": { "author": "t5w5h5", "author_email": "t5w5h5@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "rstore\n======\n\nGeneral purpose store for key/value pairs, time series and event sequences with optional encryption.\n\nValues are encrypted as soon as the *key* argument is specified with ``Store()``. Alternatively, the key\ncan be fixed for the store by setting ``Store._key``. The same store can be used in encrypted and unencrypted mode.\n*Note: Keys must be of type ``str`` and are never encrypted.*\n\nDifferent backends are available for persistence. The backend is selected by the `dsn` argument of ``Store()``:\n\n - PostgreSQL database: ``dsn='postgresql://localhost'``\n - Redis server: ``dsn='redis://localhost'``\n - SQLite data file: ``dsn='sqlite://datafile.db'``\n\nDifferent namespaces can be used within a single store. The namespace is selected with the *namespace* argument of\n``Store()`` or by setting ``Store._namespace``. If no namespace is selected it defaults to *default*.\n\nValues are stored using the pickle module (before encryption). This behavior can be changed by subclassing\n``Store`` and overwriting ``_dump`` and ``_load``. For example:\n\n.. code-block:: python\n\n class JsonStore(Store):\n def _dump(self, value):\n return json.dumps(value)\n def _load(self, data):\n return json.loads(data)\n\nKey/value\n---------\n\nFunctions for the key/value store include: ``set``, ``get``, ``delete``, ``has``, and ``keys``. The k/v store can\nalso be used in a dict-like fashion with ``s[k]``, ``del s[k]``, ``k in s``, and ``len(s)``.\n\n.. code-block:: python\n\n with Store('file.name', frozen=False) as kv:\n kv.set('some_key', value)\n value = kv.get('some_key')\n del kv['some_key']\n\nTime series\n-----------\n\nTime series are key/value pairs where the value changes over time. Each value change (or data point) is recorded\nwith a timestamp. The timestamp is an arbitrary *int* value and its meaning must be determined by the application.\nAn even frequency between the timestamps is optional.\n\nFunctions for time series include: ``range``, ``first``, ``last``, ``missing``, ``iscomplete``, ``extend``, ``remove``,\nand ``timeseries``.\n\n.. code-block:: python\n\n with Store('file.name', frozen=False) as ts:\n ts.extend('some_series', (timestamp1, value1), ...)\n timestamp, value = ts.last('some_series')\n ts.remove('some_series')\n\nEvent sequences\n---------------\n\nEvent sequences are key/dict pairs where each change to the dict is recorded as an event.\nEvents are stored as tuple ``(timestamp, item, op, value)`` where:\n\n- ``timestamp`` is the POSIX timestamp in milliseconds when the event was recorded (type ``int``)\n- ``item`` is the name of the dict member (type ``str``)\n- ``op`` is the operator to apply to the dict member (``operator.setitem``, ``operator.delitem``, ``operator.add``, ...)\n- ``value`` is the value to apply to the dict member (or ``None`` for unary operators such as ``operator.delitem``)\n\nFunctions for event sequences include: ``current``, ``past``, ``apply``, ``prune``, ``events``, and ``eventsources``.\n\n.. code-block:: python\n\n with Store('file.name', frozen=False) as es:\n es.apply('some_dict', {'item': 1}) # op defaults to operator.setitem\n es.apply('some_dict', {'item': (operator.add, 1)})\n es.events('some_dict') == [(timestamp, 'item', operator.setitem, 1), (timestamp, 'item', operator.add, 1)]\n es.current('some_dict') == {'item': 2}\n es.prune('some_dict', remove=True)\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ pip install rlib-store\n\nGetting Started\n---------------\n\n.. code-block:: python\n\n from rstore import Store\n\nCheck the doc strings and unit tests for examples.\n\nLicense\n-------\n\n\"MIT\". See LICENSE for details. Copyright t5w5h5@gmail.com, 2018.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/t5w5h5/rstore/archive/0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/t5w5h5/rstore", "keywords": "database", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "rlib-store", "package_url": "https://pypi.org/project/rlib-store/", "platform": "any", "project_url": "https://pypi.org/project/rlib-store/", "project_urls": { "Download": "https://github.com/t5w5h5/rstore/archive/0.1.tar.gz", "Homepage": "https://github.com/t5w5h5/rstore" }, "release_url": "https://pypi.org/project/rlib-store/0.1/", "requires_dist": null, "requires_python": "", "summary": "General purpose store for key/value pairs, time series and event sequences with optional encryption.", "version": "0.1" }, "last_serial": 3745845, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0e99754a0f028372c395870b46f4a7d8", "sha256": "64e35aa3fa33418b24e483463e4b5f8c0d13906a26ef4bd440f9728a65ab99c3" }, "downloads": -1, "filename": "rlib-store-0.1.tar.gz", "has_sig": false, "md5_digest": "0e99754a0f028372c395870b46f4a7d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11505, "upload_time": "2018-04-08T13:09:26", "url": "https://files.pythonhosted.org/packages/fc/0f/0a645d82630560a77bec64672091bec23f3039beb7f4eb69571284f7a80e/rlib-store-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e99754a0f028372c395870b46f4a7d8", "sha256": "64e35aa3fa33418b24e483463e4b5f8c0d13906a26ef4bd440f9728a65ab99c3" }, "downloads": -1, "filename": "rlib-store-0.1.tar.gz", "has_sig": false, "md5_digest": "0e99754a0f028372c395870b46f4a7d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11505, "upload_time": "2018-04-08T13:09:26", "url": "https://files.pythonhosted.org/packages/fc/0f/0a645d82630560a77bec64672091bec23f3039beb7f4eb69571284f7a80e/rlib-store-0.1.tar.gz" } ] }