https://github.com/con/fscacher
Caching results of operations on heavy file trees
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.9%) to scientific vocabulary
Keywords from Contributors
datalad
Last synced: 10 months ago
·
JSON representation
Repository
Caching results of operations on heavy file trees
Basic Info
Statistics
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 22
- Releases: 14
Created about 6 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
License
README.rst
.. image:: https://github.com/con/fscacher/workflows/Test/badge.svg?branch=master
:target: https://github.com/con/fscacher/actions?workflow=Test
:alt: CI Status
.. image:: https://codecov.io/gh/con/fscacher/branch/master/graph/badge.svg
:target: https://codecov.io/gh/con/fscacher
.. image:: https://img.shields.io/pypi/pyversions/fscacher.svg
:target: https://pypi.org/project/fscacher/
.. image:: https://img.shields.io/github/license/con/fscacher.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT License
`GitHub `_
| `PyPI `_
| `Issues `_
| `Changelog `_
``fscacher`` provides a cache & decorator for memoizing functions whose outputs
depend upon the contents of a file argument.
If you have a function ``foo()`` that takes a file path as its first argument,
and if the behavior of ``foo()`` is pure in the *contents* of the path and the
values of its other arguments, ``fscacher`` can help cache that function, like
so:
.. code:: python
from fscacher import PersistentCache
cache = PersistentCache("insert_name_for_cache_here")
@cache.memoize_path
def foo(path, ...):
...
Now the outputs of ``foo()`` will be cached for each set of input arguments and
for a "fingerprint" (timestamps & size) of each ``path``. If ``foo()`` is
called twice with the same set of arguments, the result from the first call
will be reused for the second, unless the file pointed to by ``path`` changes,
in which case the function will be run again. If ``foo()`` is called with a
non-`path-like object
`_ as the value
of ``path``, the cache is ignored.
``memoize_path()`` optionally takes an ``exclude_kwargs`` argument, which must
be a sequence of names of arguments of the decorated function that will be
ignored for caching purposes.
Caches are stored on-disk and thus persist between Python runs. To clear a
given ``PersistentCache`` and erase its data store, call the ``clear()``
method.
By default, caches are stored in the user-wide cache directory, under an
fscacher-specific folder, with each one identified by the name passed to the
constructor (which defaults to "cache" if not specified). To specify a
different location, use the ``path`` argument to the constructor instead of
passing a name:
.. code:: python
cache = PersistentCache(path="/my/custom/location")
If your code runs in an environment where different sets of libraries or the
like could be used in different runs, and these make a difference to the output
of your function, you can make the caching take them into account by passing a
list of library version strings or other identifiers for the current run as the
``token`` argument to the ``PersistentCache`` constructor.
Finally, ``PersistentCache``'s constructor also optionally takes an ``envvar``
argument giving the name of an environment variable. If that environment
variable is set to "``clear``" when the cache is constructed, the cache's
``clear()`` method will be called at the end of initialization. If the
environment variable is set to "``ignore``" instead, then caching will be
disabled, and the cache's ``memoize_path`` method will be a no-op. If the
given environment variable is not set, or if ``envvar`` is not specified, then
``PersistentCache`` will query the ``FSCACHER_CACHE`` environment variable
instead.
Installation
============
``fscacher`` requires Python 3.9 or higher. Just use `pip
`_ for Python 3 (You have pip, right?) to install it and
its dependencies::
python3 -m pip install fscacher
Owner
- Name: Center for Open Neuroscience
- Login: con
- Kind: organization
- Email: debian@oneukrainian.com
- Location: Dartmouth College, USA
- Website: http://centerforopenneuroscience.org
- Repositories: 13
- Profile: https://github.com/con
GitHub Events
Total
- Create event: 8
- Issues event: 2
- Release event: 2
- Watch event: 1
- Delete event: 4
- Issue comment event: 13
- Push event: 10
- Pull request review event: 2
- Pull request event: 9
Last Year
- Create event: 8
- Issues event: 2
- Release event: 2
- Watch event: 1
- Delete event: 4
- Issue comment event: 13
- Push event: 10
- Pull request review event: 2
- Pull request event: 9
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| John T. Wodder II | g****t@v****g | 75 |
| Yaroslav Halchenko | d****n@o****m | 9 |
| auto | a****o@n****l | 8 |
| John T. Wodder II | j****r@u****m | 2 |
Committer Domains (Top 20 + Academic)
onerussian.com: 1
varonathe.org: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 33
- Total pull requests: 70
- Average time to close issues: 3 months
- Average time to close pull requests: about 2 months
- Total issue authors: 3
- Total pull request authors: 3
- Average comments per issue: 2.79
- Average comments per pull request: 2.0
- Merged pull requests: 55
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 0
- Pull requests: 7
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.86
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- yarikoptic (29)
- jwodder (3)
- hosiet (2)
- sneakers-the-rat (1)
Pull Request Authors
- jwodder (48)
- yarikoptic (22)
- dependabot[bot] (7)
Top Labels
Issue Labels
enhancement (3)
bug (2)
os-windows (2)
performance (1)
blocked (1)
Pull Request Labels
internal (18)
release (17)
tests (17)
patch (11)
minor (7)
performance (5)
major (3)
dependencies (1)
Packages
- Total packages: 2
-
Total downloads:
- pypi 31,678 last-month
- Total docker downloads: 15
-
Total dependent packages: 4
(may contain duplicates) -
Total dependent repositories: 2
(may contain duplicates) - Total versions: 15
- Total maintainers: 2
pypi.org: fscacher
Caching results of operations on heavy file trees
- Homepage: https://github.com/con/fscacher
- Documentation: https://fscacher.readthedocs.io/
- License: MIT
-
Latest release: 0.4.4
published over 1 year ago
Rankings
Downloads: 2.3%
Docker downloads count: 3.2%
Dependent packages count: 3.3%
Dependent repos count: 11.9%
Average: 13.7%
Forks count: 22.8%
Stargazers count: 38.9%
Maintainers (2)
Last synced:
11 months ago
conda-forge.org: fscacher
fscacher provides a cache & decorator for memoizing functions whose outputs depend upon the contents of a file argument.
- Homepage: https://github.com/con/fscacher
- License: MIT
-
Latest release: 0.2.0
published over 4 years ago
Rankings
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Average: 45.7%
Forks count: 57.4%
Stargazers count: 62.4%
Last synced:
11 months ago
Dependencies
.github/workflows/benchmark.yml
actions
- actions/checkout v4 composite
- actions/setup-python v4 composite
.github/workflows/release.yml
actions
- actions/checkout v4 composite
- actions/setup-python v4 composite
.github/workflows/test.yml
actions
- actions/checkout v4 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
pyproject.toml
pypi
setup.py
pypi