Skip to main content

$XDG_CACHE_HOME read/write files

Project description

Travis

Install

$ [sudo] pip install xdg-cache

Functions

function __doc__
xdg_cache.exists(key) return True if cache exists, else False
xdg_cache.read(key) return a file content string, return None if cache not exist
xdg_cache.rm(key) remove cache file
xdg_cache.write(key, string) write string to cache

Examples

>>> import xdg_cache
>>> xdg_cache.write("key",'value')
>>> xdg_cache.read("key")
'value'
>>> xdg_cache.path("key")
'~/.cache/key'
>>> xdg_cache.exists("key")
True
>>> xdg_cache.rm("key")

readme-md - README.md generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xdg-cache-2019.3.23.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

xdg_cache-2019.3.23-py2.py3-none-any.whl (194.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page