Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

store cache files outside of repo

Project description

Installation

$ [sudo] pip install repo-cache

Benefits

  • separate generated and manual created files
  • easier to search
  • less backup files

How it works

$REPO_CACHE_HOME/<repo-sha1>/<key>

Config

$REPO_CACHE_HOME - default is $XDG_CACHE_HOME/repo-cache, i.g.: ~/.cache/repo-cache

Functions

function __doc__
repo_cache.clear() clear repo cache
repo_cache.fullpath(key) return a string with a cache file full path
repo_cache.read(key) return a cached string
repo_cache.shasum() return a string with sha1 checksum for a current repo (working dir)
repo_cache.write(key, string) write a string to a repo cache and return a cache file full path

Scripts usage

usage: repo-cache

Examples

$ path="$(repo-cache)"/requirements.txt
~/.cache/repo-cache/<repo-sha1>/requirements.txt
$ pipreqs --ignore tests --print . > "$path"
$ ln -fs "$path" requirements.txt
$ ln -fs "$(repo-cache)" .cache # symlink cache folder for debug
$ echo "/.cache" >> ~/.gitignore

Related projects

python-readme-generator

Project details


Download files

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

Files for repo-cache, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size repo-cache-2019.4.13.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page