pyBiocFileCache 0.7.0__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. pybiocfilecache-0.8.0/.coveragerc +13 -0
  2. pybiocfilecache-0.8.0/.github/dependabot.yml +15 -0
  3. pybiocfilecache-0.8.0/.github/workflows/pre-commit.yml +16 -0
  4. pybiocfilecache-0.8.0/.github/workflows/publish-pypi.yml +91 -0
  5. pybiocfilecache-0.8.0/.github/workflows/r-interop-tests.yml +55 -0
  6. pybiocfilecache-0.8.0/.github/workflows/run-tests.yml +70 -0
  7. pybiocfilecache-0.8.0/.gitignore +112 -0
  8. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/.pre-commit-config.yaml +6 -4
  9. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/CHANGELOG.md +5 -0
  10. pybiocfilecache-0.8.0/CONTRIBUTING.md +20 -0
  11. pybiocfilecache-0.8.0/PKG-INFO +59 -0
  12. pybiocfilecache-0.8.0/README.md +4 -0
  13. pybiocfilecache-0.8.0/docs/authors.md +1 -0
  14. pybiocfilecache-0.8.0/docs/best_practices.md +49 -0
  15. pybiocfilecache-0.8.0/docs/changelog.md +1 -0
  16. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/docs/conf.py +60 -38
  17. pybiocfilecache-0.8.0/docs/contributing.md +4 -0
  18. pybiocfilecache-0.8.0/docs/license.md +5 -0
  19. pybiocfilecache-0.8.0/docs/readme.md +1 -0
  20. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/docs/requirements.txt +2 -1
  21. pybiocfilecache-0.8.0/pyproject.toml +88 -0
  22. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/cache.py +316 -124
  23. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/config.py +1 -2
  24. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/models.py +2 -1
  25. pybiocfilecache-0.8.0/src/pybiocfilecache/py.typed +0 -0
  26. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/utils.py +15 -7
  27. pybiocfilecache-0.8.0/tests/test_cache.py +370 -0
  28. pybiocfilecache-0.8.0/tests/test_r_interop.py +146 -0
  29. pybiocfilecache-0.8.0/tox.ini +62 -0
  30. pybiocfilecache-0.7.0/.coveragerc +0 -28
  31. pybiocfilecache-0.7.0/.github/workflows/publish-pypi.yml +0 -55
  32. pybiocfilecache-0.7.0/.github/workflows/run-tests.yml +0 -33
  33. pybiocfilecache-0.7.0/.gitignore +0 -56
  34. pybiocfilecache-0.7.0/.readthedocs.yml +0 -23
  35. pybiocfilecache-0.7.0/CONTRIBUTING.rst +0 -353
  36. pybiocfilecache-0.7.0/PKG-INFO +0 -117
  37. pybiocfilecache-0.7.0/README.md +0 -92
  38. pybiocfilecache-0.7.0/docs/authors.md +0 -5
  39. pybiocfilecache-0.7.0/docs/best_practices.md +0 -28
  40. pybiocfilecache-0.7.0/docs/changelog.md +0 -52
  41. pybiocfilecache-0.7.0/docs/contributing.rst +0 -1
  42. pybiocfilecache-0.7.0/docs/license.rst +0 -7
  43. pybiocfilecache-0.7.0/docs/readme.md +0 -92
  44. pybiocfilecache-0.7.0/pyproject.toml +0 -27
  45. pybiocfilecache-0.7.0/setup.cfg +0 -75
  46. pybiocfilecache-0.7.0/setup.py +0 -20
  47. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/PKG-INFO +0 -117
  48. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/SOURCES.txt +0 -42
  49. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/dependency_links.txt +0 -1
  50. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/not-zip-safe +0 -1
  51. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/requires.txt +0 -10
  52. pybiocfilecache-0.7.0/src/pyBiocFileCache.egg-info/top_level.txt +0 -1
  53. pybiocfilecache-0.7.0/tests/test_cache.py +0 -139
  54. pybiocfilecache-0.7.0/tox.ini +0 -72
  55. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/AUTHORS.md +0 -0
  56. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/LICENSE.txt +0 -0
  57. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/docs/Makefile +0 -0
  58. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/docs/_static/.gitignore +0 -0
  59. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/docs/index.md +0 -0
  60. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/__init__.py +0 -0
  61. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/src/pybiocfilecache/const.py +0 -0
  62. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/tests/conftest.py +0 -0
  63. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/tests/data/test1.txt +0 -0
  64. {pybiocfilecache-0.7.0 → pybiocfilecache-0.8.0}/tests/data/test2.txt +0 -0
@@ -0,0 +1,13 @@
1
+ [run]
2
+ source = src
3
+ omit = tests/*
4
+
5
+ [report]
6
+ exclude_lines =
7
+ pragma: no cover
8
+ def __repr__
9
+ if self.debug:
10
+ raise AssertionError
11
+ raise NotImplementedError
12
+ if 0:
13
+ if __name__ == .__main__.:
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ labels:
8
+ - "dependencies"
9
+
10
+ - package-ecosystem: "pip"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ labels:
15
+ - "dependencies"
@@ -0,0 +1,16 @@
1
+ name: pre-commit
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ pre-commit:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: '3.12'
16
+ - uses: pre-commit/action@v3.0.1
@@ -0,0 +1,91 @@
1
+ name: Publish to PyPI and GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ tags: "*"
6
+
7
+ jobs:
8
+ build-and-test:
9
+ name: Build and Test
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v7
13
+
14
+ - name: Set up Python 3.12
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: 3.12
18
+
19
+ - name: Install tox
20
+ run: python -m pip install tox
21
+
22
+ - name: Test
23
+ run: tox -e default
24
+
25
+ - name: Build Project
26
+ run: tox -e build
27
+
28
+ - name: Store the distribution packages
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: python-package-distributions
32
+ path: dist/
33
+
34
+ build-docs:
35
+ name: Build Documentation
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v7
39
+
40
+ - name: Set up Python 3.12
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: 3.12
44
+
45
+ - name: Install tox
46
+ run: python -m pip install tox
47
+
48
+ - name: Build docs
49
+ run: tox -e docs
50
+
51
+ - name: Add .nojekyll
52
+ run: touch ./docs/_build/html/.nojekyll
53
+
54
+ - name: Upload Pages artifact
55
+ uses: actions/upload-pages-artifact@v5
56
+ with:
57
+ path: ./docs/_build/html
58
+
59
+ publish-pypi:
60
+ name: Publish to PyPI
61
+ needs: build-and-test
62
+ runs-on: ubuntu-latest
63
+ environment:
64
+ name: pypi
65
+ url: https://pypi.org/p/biocframe
66
+ permissions:
67
+ id-token: write # IMPORTANT: mandatory for trusted publishing
68
+ steps:
69
+ - name: Download all the dists
70
+ uses: actions/download-artifact@v8
71
+ with:
72
+ name: python-package-distributions
73
+ path: dist/
74
+
75
+ - name: Publish package to PyPI
76
+ uses: pypa/gh-action-pypi-publish@release/v1
77
+
78
+ deploy-pages:
79
+ name: Deploy GitHub Pages
80
+ needs: build-docs
81
+ runs-on: ubuntu-latest
82
+ permissions:
83
+ pages: write
84
+ id-token: write
85
+ environment:
86
+ name: github-pages
87
+ url: ${{ steps.deployment.outputs.page_url }}
88
+ steps:
89
+ - name: Deploy to GitHub Pages
90
+ id: deployment
91
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,55 @@
1
+ name: R and Python Interop Tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - master
11
+ - main
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ concurrency:
18
+ group: >-
19
+ ${{ github.workflow }}-${{ github.ref_type }}-
20
+ ${{ github.event.pull_request.number || github.sha }}
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ r-python-roundtrip:
25
+ runs-on: ubuntu-latest
26
+ name: R (BiocFileCache) <-> Python roundtrip
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+
34
+ - name: Install Python dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ pip install -e ".[testing]"
38
+
39
+ - uses: r-lib/actions/setup-r@v2
40
+ with:
41
+ use-public-rspm: true
42
+
43
+ - name: Install R BiocFileCache
44
+ run: |
45
+ Rscript -e '
46
+ if (!requireNamespace("BiocManager", quietly = TRUE))
47
+ install.packages("BiocManager", repos = "https://cloud.r-project.org")
48
+ BiocManager::install("BiocFileCache", ask = FALSE, update = FALSE)
49
+ '
50
+
51
+ - name: Verify R BiocFileCache is available
52
+ run: Rscript -e "library(BiocFileCache)"
53
+
54
+ - name: Run R/Python roundtrip tests
55
+ run: pytest tests/test_r_interop.py -v
@@ -0,0 +1,70 @@
1
+ name: Test the library
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master # for legacy repos
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - master # for legacy repos
11
+ - main
12
+ workflow_dispatch: # Allow manually triggering the workflow
13
+ schedule:
14
+ # Run roughly every 15 days at 00:00 UTC
15
+ # (useful to check if updates on dependencies break the package)
16
+ - cron: "0 0 1,16 * *"
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ concurrency:
22
+ group: >-
23
+ ${{ github.workflow }}-${{ github.ref_type }}-
24
+ ${{ github.event.pull_request.number || github.sha }}
25
+ cancel-in-progress: true
26
+
27
+ jobs:
28
+ test:
29
+ strategy:
30
+ matrix:
31
+ python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
32
+ platform:
33
+ - ubuntu-latest
34
+ - macos-latest
35
+ # - windows-latest
36
+ runs-on: ${{ matrix.platform }}
37
+ name: Python ${{ matrix.python }}, ${{ matrix.platform }}
38
+ steps:
39
+ - uses: actions/checkout@v7
40
+
41
+ - name: Set up Python
42
+ uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python }}
45
+
46
+ - name: Install tox
47
+ run: python -m pip install tox coverage
48
+
49
+ - name: Run tests
50
+ run: >-
51
+ tox
52
+ -- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml # pytest args
53
+
54
+ - name: Check for codecov token availability
55
+ id: codecov-check
56
+ shell: bash
57
+ run: |
58
+ if [ ${{ secrets.CODECOV_TOKEN }} != '' ]; then
59
+ echo "codecov=true" >> $GITHUB_OUTPUT;
60
+ else
61
+ echo "codecov=false" >> $GITHUB_OUTPUT;
62
+ fi
63
+
64
+ - name: Upload coverage reports to Codecov with GitHub Action
65
+ uses: codecov/codecov-action@v7
66
+ if: ${{ steps.codecov-check.outputs.codecov == 'true' }}
67
+ with:
68
+ token: ${{ secrets.CODECOV_TOKEN }}
69
+ slug: ${{ github.repository }}
70
+ flags: ${{ matrix.platform }} - py${{ matrix.python }}
@@ -0,0 +1,112 @@
1
+ # Temporary and binary files
2
+ *~
3
+ *.py[cod]
4
+ *.so
5
+ *.cfg
6
+ !.isort.cfg
7
+ !setup.cfg
8
+ *.orig
9
+ *.log
10
+ *.pot
11
+ __pycache__/*
12
+ .cache/*
13
+ .*.swp
14
+ */.ipynb_checkpoints/*
15
+ .DS_Store
16
+
17
+ # Project files
18
+ .ropeproject
19
+ .project
20
+ .pydevproject
21
+ .settings
22
+ .idea
23
+ .vscode
24
+ tags
25
+
26
+ # Package files
27
+ *.egg
28
+ *.eggs/
29
+ .installed.cfg
30
+ *.egg-info
31
+
32
+ # Unittest and coverage
33
+ htmlcov/*
34
+ .coverage
35
+ .coverage.*
36
+ .tox
37
+ junit*.xml
38
+ coverage.xml
39
+ .pytest_cache/
40
+
41
+ # Build and docs folder/files
42
+ build/*
43
+ dist/*
44
+ sdist/*
45
+ docs/api/*
46
+ docs/_rst/*
47
+ docs/_build/*
48
+ cover/*
49
+ MANIFEST
50
+
51
+ # Per-project virtualenvs
52
+ .venv*/
53
+ .conda*/
54
+
55
+ # remove cache
56
+ cache
57
+
58
+ # Byte-compiled / optimized / DLL files
59
+ __pycache__/
60
+ *$py.class
61
+ # C extensions
62
+ # Distribution / packaging
63
+ .Python
64
+ build/
65
+ develop-eggs/
66
+ dist/
67
+ downloads/
68
+ eggs/
69
+ .eggs/
70
+ lib/
71
+ lib64/
72
+ parts/
73
+ sdist/
74
+ var/
75
+ wheels/
76
+ share/python-wheels/
77
+ *.egg-info/
78
+ # PyInstaller
79
+ *.manifest
80
+ *.spec
81
+ # Installer logs
82
+ pip-log.txt
83
+ pip-delete-this-directory.txt
84
+ # Unit test / coverage reports
85
+ htmlcov/
86
+ .tox/
87
+ .nox/
88
+ .cache
89
+ nosetests.xml
90
+ *.cover
91
+ *.py,cover
92
+ .hypothesis/
93
+ cover/
94
+ # Sphinx documentation
95
+ docs/_build/
96
+ # Environments
97
+ .env
98
+ .venv
99
+ env/
100
+ venv/
101
+ ENV/
102
+ env.bak/
103
+ venv.bak/
104
+ # mypy, ruff, etc
105
+ .mypy_cache/
106
+ .ruff_cache/
107
+ .pyre/
108
+ # Editors
109
+ .vscode/
110
+ .idea/
111
+ *.swp
112
+ *.swo
@@ -2,7 +2,7 @@ exclude: '^docs/conf.py'
2
2
 
3
3
  repos:
4
4
  - repo: https://github.com/pre-commit/pre-commit-hooks
5
- rev: v5.0.0
5
+ rev: v6.0.0
6
6
  hooks:
7
7
  - id: trailing-whitespace
8
8
  - id: check-added-large-files
@@ -33,10 +33,12 @@ repos:
33
33
 
34
34
  - repo: https://github.com/astral-sh/ruff-pre-commit
35
35
  # Ruff version.
36
- rev: v0.11.0
36
+ rev: v0.16.2
37
37
  hooks:
38
- - id: ruff
39
- args: [--fix, --exit-non-zero-on-fix]
38
+ # Run the linter.
39
+ - id: ruff-check
40
+ args: [--fix, --exit-zero]
41
+ # Run the formatter.
40
42
  - id: ruff-format
41
43
 
42
44
  ## If like to embrace black styles even in the docs:
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.8.0
4
+
5
+ - Upgrade to hatchit template
6
+ - Fix issues with shared caches with R and Python interfaces. Added actions to test shared cache usage.
7
+
3
8
  ## Version 0.7.0
4
9
 
5
10
  - Fixing issues with using R and Python interfaces to the same cache directory.
@@ -0,0 +1,20 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
4
+
5
+ ## Report Bugs
6
+ Report bugs at the issue tracker.
7
+
8
+ ## Fix Bugs
9
+ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
10
+
11
+ ## Implement Features
12
+ Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
13
+
14
+ ## Submit Feedback
15
+ The best way to send feedback is to file an issue.
16
+
17
+ If you are proposing a feature:
18
+ - Explain in detail how it would work.
19
+ - Keep the scope as narrow as possible, to make it easier to implement.
20
+ - Remember that this is a volunteer-driven project, and that contributions are welcome!
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.5
2
+ Name: pybiocfilecache
3
+ Version: 0.8.0
4
+ Summary: File based cache for resources and metadata
5
+ Project-URL: Homepage, https://github.com/BiocPy/pybiocfilecache
6
+ Project-URL: Documentation, https://biocpy.github.io/pybiocfilecache
7
+ Project-URL: Repository, https://github.com/BiocPy/pybiocfilecache
8
+ Project-URL: Bug Tracker, https://github.com/BiocPy/pybiocfilecache/issues
9
+ Author-email: Jayaram Kancherla <jayaram.kancherla@gmail.com>
10
+ License: The MIT License (MIT)
11
+
12
+ Copyright (c) 2021 Genentech, Inc.
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: AUTHORS.md
32
+ License-File: LICENSE.txt
33
+ Keywords: biocfilecache,cache,file-cache,resource-management,sqlite
34
+ Classifier: Development Status :: 4 - Beta
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: Intended Audience :: Science/Research
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Operating System :: OS Independent
39
+ Classifier: Programming Language :: Python :: 3
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Classifier: Programming Language :: Python :: 3.13
44
+ Classifier: Programming Language :: Python :: 3.14
45
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
46
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
47
+ Requires-Python: >=3.9
48
+ Requires-Dist: biocframe
49
+ Requires-Dist: sqlalchemy
50
+ Provides-Extra: testing
51
+ Requires-Dist: pytest; extra == 'testing'
52
+ Requires-Dist: pytest-cov; extra == 'testing'
53
+ Requires-Dist: setuptools; extra == 'testing'
54
+ Description-Content-Type: text/markdown
55
+
56
+ ```{include} ../README.md
57
+ :relative-docs: docs/
58
+ :relative-images:
59
+ ```
@@ -0,0 +1,4 @@
1
+ ```{include} ../README.md
2
+ :relative-docs: docs/
3
+ :relative-images:
4
+ ```
@@ -0,0 +1 @@
1
+ ../AUTHORS.md
@@ -0,0 +1,49 @@
1
+ # Best Practices
2
+
3
+ 1. Use context managers for automatic database cleanup:
4
+ ```python
5
+ from pybiocfilecache import BiocFileCache
6
+
7
+ with BiocFileCache("cache_directory") as cache:
8
+ cache.add("myfile", "path/to/file.txt")
9
+ ```
10
+
11
+ 2. Look up resources by `rname` or `rid`, and use `wait=False` to inspect missing files without waiting:
12
+ ```python
13
+ # Standard lookup (waits up to 30s if a file copy is in progress)
14
+ rec = cache.get("myfile")
15
+
16
+ # Immediate lookup when checking or repairing a missing cached file
17
+ rec = cache.get(rid="BFC1", wait=False)
18
+ ```
19
+
20
+ 3. Search, update, and remove resources by `rname` or `rid` (especially useful when sharing a cache with R `BiocFileCache`):
21
+ ```python
22
+ matches = cache.search("myfile", field="rname", exact=False)
23
+ cache.update(rid="BFC1", fpath="path/to/new_file.txt")
24
+ cache.remove(rid="BFC1")
25
+ ```
26
+
27
+ 4. Set expiration dates for temporary files:
28
+ ```python
29
+ from datetime import datetime, timedelta, timezone
30
+
31
+ cache.add(
32
+ "temp.txt",
33
+ "temp.txt",
34
+ expires=datetime.now(timezone.utc) + timedelta(hours=1),
35
+ )
36
+ ```
37
+
38
+ 5. Regular maintenance and integrity checks:
39
+ ```python
40
+ # Remove expired resources
41
+ cache.cleanup()
42
+
43
+ # Verify checksums of cached files
44
+ valid, invalid = cache.verify_cache()
45
+
46
+ # Monitor cache statistics
47
+ stats = cache.get_stats()
48
+ print(stats["total_resources"], stats["expired_resources"])
49
+ ```
@@ -0,0 +1 @@
1
+ ../CHANGELOG.md