cacheasy


Namecacheasy JSON
Version 0.0.6 PyPI version JSON
download
home_pageNone
SummaryA simple package for caching python objects.
upload_time2024-08-09 09:39:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cacheasy

This is a simple utility Python package for caching Python objects. Makes use of the `pickle` standard library and simply stores files in a folder called `cache`. If you want to use another location, you can specify `cache_folderpath` in a `.env` file.

## Writing to cache

```python
import cacheasy
x = 5
cacheasy.write_to_cache(x, 'my_cool_x')
```

## Reading from cache

```python
import cacheasy
x = cacheasy.read_from_cache('my_cool_x')
```

## Common usage

A common work flow is to check if a file is in the cache, if it is not to create it and write to cache, if the file is in cache you read it:

```python
import cacheasy
x_cache_filepath = 'my_cool_x'
if cacheasy.file_in_cache(x_cache_filepath):
    x = cacheasy.read_from_cache(x_cache_filepath)
else:
    x = 5
    cacheasy.write_to_cache(x_cache_filepath)
```

## Removing from cache

To delete a file from the cache:

```python
import cacheasy
cacheasy.remove_from_cache('my_cool_x')
```

To easily delete all cache (including the folder):

```python
import cacheasy
cacheasy.clear_cache()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cacheasy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Casper Kole <casper@voltgoed.nl>",
    "download_url": "https://files.pythonhosted.org/packages/86/f8/c03391d50ab6b541ed5393a8e4a9511cf2e42f29ca455de35d79e6198567/cacheasy-0.0.6.tar.gz",
    "platform": null,
    "description": "# Cacheasy\r\n\r\nThis is a simple utility Python package for caching Python objects. Makes use of the `pickle` standard library and simply stores files in a folder called `cache`. If you want to use another location, you can specify `cache_folderpath` in a `.env` file.\r\n\r\n## Writing to cache\r\n\r\n```python\r\nimport cacheasy\r\nx = 5\r\ncacheasy.write_to_cache(x, 'my_cool_x')\r\n```\r\n\r\n## Reading from cache\r\n\r\n```python\r\nimport cacheasy\r\nx = cacheasy.read_from_cache('my_cool_x')\r\n```\r\n\r\n## Common usage\r\n\r\nA common work flow is to check if a file is in the cache, if it is not to create it and write to cache, if the file is in cache you read it:\r\n\r\n```python\r\nimport cacheasy\r\nx_cache_filepath = 'my_cool_x'\r\nif cacheasy.file_in_cache(x_cache_filepath):\r\n    x = cacheasy.read_from_cache(x_cache_filepath)\r\nelse:\r\n    x = 5\r\n    cacheasy.write_to_cache(x_cache_filepath)\r\n```\r\n\r\n## Removing from cache\r\n\r\nTo delete a file from the cache:\r\n\r\n```python\r\nimport cacheasy\r\ncacheasy.remove_from_cache('my_cool_x')\r\n```\r\n\r\nTo easily delete all cache (including the folder):\r\n\r\n```python\r\nimport cacheasy\r\ncacheasy.clear_cache()\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple package for caching python objects.",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/casper-voltgoed/cacheasy",
        "Issues": "https://github.com/casper-voltgoed/cacheasy/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5bca6dd6b926e824818f0e2d2cc1eeafc2472130b904e514ab9036d53019491",
                "md5": "f28d0c93f279ed82489845a5be92e63c",
                "sha256": "4cfd9ec7ac1ff52f246e2ae058649d4ba3645d67852f79d249814cf51854d98e"
            },
            "downloads": -1,
            "filename": "cacheasy-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f28d0c93f279ed82489845a5be92e63c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 3209,
            "upload_time": "2024-08-09T09:39:09",
            "upload_time_iso_8601": "2024-08-09T09:39:09.023036Z",
            "url": "https://files.pythonhosted.org/packages/a5/bc/a6dd6b926e824818f0e2d2cc1eeafc2472130b904e514ab9036d53019491/cacheasy-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86f8c03391d50ab6b541ed5393a8e4a9511cf2e42f29ca455de35d79e6198567",
                "md5": "7a78a68ad407a682ade3767edc08cba2",
                "sha256": "5cce5eb5b908a2f2da4c2f436b8cba35516d5cdf8eb0b870ad71cd44a0008afb"
            },
            "downloads": -1,
            "filename": "cacheasy-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "7a78a68ad407a682ade3767edc08cba2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3473,
            "upload_time": "2024-08-09T09:39:10",
            "upload_time_iso_8601": "2024-08-09T09:39:10.381180Z",
            "url": "https://files.pythonhosted.org/packages/86/f8/c03391d50ab6b541ed5393a8e4a9511cf2e42f29ca455de35d79e6198567/cacheasy-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-09 09:39:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "casper-voltgoed",
    "github_project": "cacheasy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cacheasy"
}
        
Elapsed time: 0.61897s