https://github.com/yaph/fscache
A Python package for caching data in the file system.
https://github.com/yaph/fscache
cache caching file-system filesystem json pypi-package python-library serialization
Last synced: about 2 months ago
JSON representation
A Python package for caching data in the file system.
- Host: GitHub
- URL: https://github.com/yaph/fscache
- Owner: yaph
- License: mit
- Created: 2020-01-03T01:50:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-26T23:45:38.000Z (over 2 years ago)
- Last Synced: 2026-03-13T01:59:57.269Z (3 months ago)
- Topics: cache, caching, file-system, filesystem, json, pypi-package, python-library, serialization
- Language: Python
- Homepage: https://pypi.org/project/fscache
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
# fscache
**fscache** is a Python package for caching data in the file system.
## Installation
```sh
pip install fscache
```
## Usage
```python
import requests
from fscache import fscache
url = 'https://example.com/index.html'
cache_file = fscache.path(url, cache_dir='.fscache')
if fscache.valid(cache_file, lifetime=3600):
content = fscache.load(cache_file)
# Do something with content
else:
content = requests.get(url).text
# Save content in .fscache/https/example.com/index.html
fscache.save(cache_file, content)
```
## License
[MIT](LICENSE) © [Ramiro Gómez](https://ramiro.org/)