{ "info": { "author": "gyrao", "author_email": "pedrogyrao@hotmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Volatile Sets Dictionary\nThis project aims to extend python's native dictionary class, in order to add volatile sets.\nVolatile sets are a combination of key and value that expires after a period of time. This time is decided by the user.\n___\n## Instalatiton\nYou can install it using pip with the following command.\n```console\npip install volatile_dictionary\n```\nTo install it by cloning its github repository, use the following commands. The \"-e\" flag install it in the path you clone it to, so, changes in the code will be instantly valid for the package users.\n```console\ngit clone https://github.com/pedrogyrao/volatile_dictionary\ncd volatile_dictionary\npip install -e .\n```\n\n___\n## Using the VolatileDictionary Class\nFirst import it in your project:\n```python\nfrom volatile_dictionary import VolatileDictionary\n```\nThen instantiate it:\n```python\nvolatile_dict = VolatileDictionary()\n```\n___\nVolatileDictionary works as a normal dictionary\n```python\nvolatile_dict['key'] = 'value'\nprint(volatile_dict['key'])\n```\nsaves internally the set \"{'key', 'value'}\" and outputs:\n```python\nvalue\n```\nThis set added above is nonvolatile. To add a volatile the key must be a length 2 tuple and with the second element being the set's duration time in seconds.\n```python\nvolatile_dict['volatile_key', 2] = 'volatile_value'\n```\nfor the 2 seconds after the above line is ran, this code\n```python\nprint(volatile_dict['volatile_key'])\n```\nwill output:\n```python\nvolatile_value\n```\nafter 2 seconds the set \"{'volatile_key': 'volatile_value'}\" will be deleted.\n___\nTo manipulate this volatile sets three methods were created:\n\n* is_set_volatile(key): returns \"True\" if the set is volatile and \"False\" if the set is nonvolatile.\n* get_set_lifetime(key): returns the remaining lifetime of the specified key. If the key doesn't represent a volatile set, the method raises \"NonvolatileTypeError\".\n* cancel_volatily(key): cancel the volatility of a volatile set. If the key doesn't represent a volatile set, the\tmethod raises \"NonvolatileTypeError\".\n___\nIn order to work with this differentiation between volatile and nonvolatile sets, the basic dict methods \"keys\", \"values\" and \"items\" were implemented too:\n\n* volatile_keys and nonvolatile_keys;\n* volatile_values and nonvolatile_values;\n* volatile_items and nonvolatile_items.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pedrogyrao/volatile_dictionary", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "volatile-dictionary", "package_url": "https://pypi.org/project/volatile-dictionary/", "platform": "", "project_url": "https://pypi.org/project/volatile-dictionary/", "project_urls": { "Homepage": "https://github.com/pedrogyrao/volatile_dictionary" }, "release_url": "https://pypi.org/project/volatile-dictionary/0.1/", "requires_dist": [ "apscheduler" ], "requires_python": "", "summary": "An extension of python's native dictionary class, that implements volatile sets.", "version": "0.1" }, "last_serial": 4478866, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a7df540270acf83bd24e44606412457d", "sha256": "eab1df240fdda9f5ceb1e9799e20d067aa71b7c3c4c8d403dce9e89823872a75" }, "downloads": -1, "filename": "volatile_dictionary-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a7df540270acf83bd24e44606412457d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3452, "upload_time": "2018-11-12T20:04:01", "url": "https://files.pythonhosted.org/packages/1d/d6/e0c69b91deaad64246c640719669e022e6183143fc57211f4a99ec10988f/volatile_dictionary-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0fc566a8e11bebbe32dd2d7bd0ccf28", "sha256": "d4b70d01e862261ce06297680212c2d679277f0808d3a132b2f846d5e4249a97" }, "downloads": -1, "filename": "volatile_dictionary-0.1.tar.gz", "has_sig": false, "md5_digest": "d0fc566a8e11bebbe32dd2d7bd0ccf28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3083, "upload_time": "2018-11-12T20:04:03", "url": "https://files.pythonhosted.org/packages/cf/dc/5819af1ab43d9baa903b2a5443f425969f6bfc717673e747ec489b64d8ad/volatile_dictionary-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a7df540270acf83bd24e44606412457d", "sha256": "eab1df240fdda9f5ceb1e9799e20d067aa71b7c3c4c8d403dce9e89823872a75" }, "downloads": -1, "filename": "volatile_dictionary-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a7df540270acf83bd24e44606412457d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3452, "upload_time": "2018-11-12T20:04:01", "url": "https://files.pythonhosted.org/packages/1d/d6/e0c69b91deaad64246c640719669e022e6183143fc57211f4a99ec10988f/volatile_dictionary-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0fc566a8e11bebbe32dd2d7bd0ccf28", "sha256": "d4b70d01e862261ce06297680212c2d679277f0808d3a132b2f846d5e4249a97" }, "downloads": -1, "filename": "volatile_dictionary-0.1.tar.gz", "has_sig": false, "md5_digest": "d0fc566a8e11bebbe32dd2d7bd0ccf28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3083, "upload_time": "2018-11-12T20:04:03", "url": "https://files.pythonhosted.org/packages/cf/dc/5819af1ab43d9baa903b2a5443f425969f6bfc717673e747ec489b64d8ad/volatile_dictionary-0.1.tar.gz" } ] }