{ "info": { "author": "Peter Crosby", "author_email": "p.crosby25@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: SQL", "Topic :: Database", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed" ], "description": "# lite-cache\n[![PyPi version](https://pypip.in/v/py-cache/badge.png)](https://github.com/petercrosby/lite-cache/blob/master/LICENSE)\n[![codecov](https://codecov.io/gh/petercrosby/lite-cache/branch/develop/graph/badge.svg)](https://codecov.io/gh/petercrosby/lite-cache)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/lite-cache.svg?style=flat)](https://pypi.python.org/pypi/web_cache/)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/petercrosby/lite-cache/blob/master/LICENSE)\n\n| Branch| Build Status |\n| --- | --- |\n|`master`| [![CircleCI](https://circleci.com/gh/petercrosby/lite-cache/tree/master.svg?style=svg)](https://circleci.com/gh/petercrosby/lite-cache/tree/master)|\n|`develop`| [![CircleCI](https://circleci.com/gh/petercrosby/lite-cache/tree/develop.svg?style=svg)](https://circleci.com/gh/petercrosby/lite-cache/tree/develop)|\n\nSimple sqlite key-value storage for Python3.\n\nPython3 module for caching data during a program's runtime, with optional persistence.\n\n## Features\n\n* Program specific cache.\n* Simple encoding of data using standard `json` package.\n* Optional persistence of data across multiple executions.\n - Useful for keeping some runtime data available to a program after a full exit.\n - ex. `raise Exception` or `sys.exit()`, etc\n\n## Installation (from PyPI, with PIP)\n\n`lite-cache` requires [Python](https://www.python.org/downloads/) >= 3.6.\n\n1. If not already installed, [install pip](https://pip.pypa.io/en/stable/installing/) for Python 3\n2. Install `lite_cache`\n ```bash\n $ pip3 install lite-cache\n ````\n\n### Usage\n\nTo use in default configuration:\n- Entire cache is in 1 database file, `~/.local/litecache/cache.db`\n\nTo use in custom configuration:\n\n```Python3\nimport lite_cache\n\nprogram_cache = lite_cache.LiteCache(name='MyProgramCache', location='~/.local/litecache')\n# This initializes and creates a new Sqlite3 database file in `location` directory,\n# named as \"`name`.cache\".\n# If directory does not exist, error is raised.\n\n```\n\nThis strategy of having unique caches for each program is designed to navigate \"same thread\" or \"single thread\" issues with Python & Sqlite3.\n- This would not prevent issues occurring if multiple instances of the same program were launched on the same machine.\n - ie. Executing same Python script in 2 terminal tabs. This would lead to two(2) threads attempting to access one(1) Sqlite3 with same `name`\n\n\n## Development\nThis project uses `pipenv` for managing virtual-environments and Python3 dependencies for development and testing.\n* **Reference**: https://pypi.org/project/pipenv/\n\nThe standard `requirements.txt` is included for installation via `setup.py`\n\n## Tests\n- Uses `unittests`\n\nRun all tests from `setup.py`\n```bash\npipenv run python setup.py test\n```\n\nRun specific test\n```bash\npipenv run python -m unittest tests/test_main.py\n```\n\n## Plans\n- Interface for handling Python+Sqlite3 thread limitations.\n- Data compression options\n\n\n## License\n\n[GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)\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/petercrosby/lite-cache", "keywords": "python sqlite3 cache json setuptools", "license": "GPLv3", "maintainer": "p.crosby25@gmail.com", "maintainer_email": "", "name": "lite-cache", "package_url": "https://pypi.org/project/lite-cache/", "platform": "linux", "project_url": "https://pypi.org/project/lite-cache/", "project_urls": { "Homepage": "https://github.com/petercrosby/lite-cache" }, "release_url": "https://pypi.org/project/lite-cache/0.1.3/", "requires_dist": [ "setuptools (>=41.0.1)", "unittests ; extra == 'test'", "coverage ; extra == 'test'", "codecov ; extra == 'test'" ], "requires_python": ">=3.6.0", "summary": "Simple key-value cache for Python3 using SQLite3.", "version": "0.1.3" }, "last_serial": 5497253, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "0558bb4a4c02c2ab8070a6239206a892", "sha256": "f2223e7ee2a33c8ffe16c3e7aacf1c8d79c2dec32616e082694f4e06ab09d7ee" }, "downloads": -1, "filename": "lite_cache-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0558bb4a4c02c2ab8070a6239206a892", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 17168, "upload_time": "2019-07-07T14:05:39", "url": "https://files.pythonhosted.org/packages/7c/9f/e71a7aa88cd177c57e9c2df91fed392c120f42614f31f6733b10ef7a76a1/lite_cache-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0004f04fbc5df9acbaef682273eda70", "sha256": "ee9685c579b27cedb5b69cf5bd4d47d646369c08129c74a271b96c7d200ad302" }, "downloads": -1, "filename": "lite-cache-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c0004f04fbc5df9acbaef682273eda70", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 19382, "upload_time": "2019-07-07T14:05:42", "url": "https://files.pythonhosted.org/packages/87/ff/6d967f5e138a5216bc850bee25d10ae99b1b9df2ba3be259342285b3ab19/lite-cache-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0558bb4a4c02c2ab8070a6239206a892", "sha256": "f2223e7ee2a33c8ffe16c3e7aacf1c8d79c2dec32616e082694f4e06ab09d7ee" }, "downloads": -1, "filename": "lite_cache-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0558bb4a4c02c2ab8070a6239206a892", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 17168, "upload_time": "2019-07-07T14:05:39", "url": "https://files.pythonhosted.org/packages/7c/9f/e71a7aa88cd177c57e9c2df91fed392c120f42614f31f6733b10ef7a76a1/lite_cache-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0004f04fbc5df9acbaef682273eda70", "sha256": "ee9685c579b27cedb5b69cf5bd4d47d646369c08129c74a271b96c7d200ad302" }, "downloads": -1, "filename": "lite-cache-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c0004f04fbc5df9acbaef682273eda70", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 19382, "upload_time": "2019-07-07T14:05:42", "url": "https://files.pythonhosted.org/packages/87/ff/6d967f5e138a5216bc850bee25d10ae99b1b9df2ba3be259342285b3ab19/lite-cache-0.1.3.tar.gz" } ] }