pyBiocFileCache 0.8.0__tar.gz → 0.8.1__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 (40) hide show
  1. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/CHANGELOG.md +1 -1
  2. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/PKG-INFO +99 -4
  3. pybiocfilecache-0.8.1/README.md +99 -0
  4. pybiocfilecache-0.8.0/README.md +0 -4
  5. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.coveragerc +0 -0
  6. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.github/dependabot.yml +0 -0
  7. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.github/workflows/pre-commit.yml +0 -0
  8. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.github/workflows/publish-pypi.yml +0 -0
  9. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.github/workflows/r-interop-tests.yml +0 -0
  10. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.github/workflows/run-tests.yml +0 -0
  11. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.gitignore +0 -0
  12. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/.pre-commit-config.yaml +0 -0
  13. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/AUTHORS.md +0 -0
  14. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/CONTRIBUTING.md +0 -0
  15. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/LICENSE.txt +0 -0
  16. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/Makefile +0 -0
  17. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/_static/.gitignore +0 -0
  18. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/authors.md +0 -0
  19. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/best_practices.md +0 -0
  20. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/changelog.md +0 -0
  21. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/conf.py +0 -0
  22. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/contributing.md +0 -0
  23. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/index.md +0 -0
  24. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/license.md +0 -0
  25. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/readme.md +0 -0
  26. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/docs/requirements.txt +0 -0
  27. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/pyproject.toml +0 -0
  28. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/__init__.py +0 -0
  29. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/cache.py +0 -0
  30. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/config.py +0 -0
  31. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/const.py +0 -0
  32. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/models.py +0 -0
  33. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/py.typed +0 -0
  34. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/src/pybiocfilecache/utils.py +0 -0
  35. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tests/conftest.py +0 -0
  36. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tests/data/test1.txt +0 -0
  37. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tests/data/test2.txt +0 -0
  38. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tests/test_cache.py +0 -0
  39. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tests/test_r_interop.py +0 -0
  40. {pybiocfilecache-0.8.0 → pybiocfilecache-0.8.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## Version 0.8.0
3
+ ## Version 0.8.0 - 0.8.1
4
4
 
5
5
  - Upgrade to hatchit template
6
6
  - Fix issues with shared caches with R and Python interfaces. Added actions to test shared cache usage.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pybiocfilecache
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: File based cache for resources and metadata
5
5
  Project-URL: Homepage, https://github.com/BiocPy/pybiocfilecache
6
6
  Project-URL: Documentation, https://biocpy.github.io/pybiocfilecache
@@ -53,7 +53,102 @@ Requires-Dist: pytest-cov; extra == 'testing'
53
53
  Requires-Dist: setuptools; extra == 'testing'
54
54
  Description-Content-Type: text/markdown
55
55
 
56
- ```{include} ../README.md
57
- :relative-docs: docs/
58
- :relative-images:
56
+ [![PyPI-Server](https://img.shields.io/pypi/v/pyBiocFileCache.svg)](https://pypi.org/project/pyBiocFileCache/)
57
+ ![Unit tests](https://github.com/BiocPy/pybiocfilecache/actions/workflows/run-tests.yml/badge.svg)
58
+ ![R and Python Interop](https://github.com/BiocPy/pybiocfilecache/actions/workflows/r-interop-tests.yml/badge.svg)
59
+
60
+ # pyBiocFileCache
61
+
62
+ `pyBiocFileCache` is a Python package that provides a file caching system with resource validation, expiration management, and SQLite-backed metadata. Compatible with the [BiocFileCache R package](https://github.com/Bioconductor/BiocFileCache).
63
+
64
+ ## Installation
65
+
66
+ Install from [PyPI](https://pypi.org/project/pyBiocFileCache/):
67
+
68
+ ```bash
69
+ pip install pybiocfilecache
70
+ ```
71
+
72
+ ## Quick Start
73
+
74
+ ```python
75
+ from pybiocfilecache import BiocFileCache
76
+
77
+ # Initialize cache
78
+ cache = BiocFileCache("path/to/cache/directory")
79
+
80
+ # Add a file to cache
81
+ resource = cache.add("myfile", "path/to/file.txt")
82
+
83
+ # Retrieve a file from cache
84
+ resource = cache.get("myfile")
85
+
86
+ # Use the cached file
87
+ print(resource["rpath"]) # Path to cached file
88
+ ```
89
+
90
+ ## Advanced Usage
91
+
92
+ ### Configuration
93
+
94
+ ```python
95
+ from datetime import timedelta
96
+ from pathlib import Path
97
+
98
+ from pybiocfilecache import BiocFileCache, CacheConfig
99
+
100
+ # Create custom configuration
101
+ config = CacheConfig(
102
+ cache_dir=Path("cache_directory"),
103
+ cleanup_interval=timedelta(days=7),
104
+ )
105
+
106
+ # Initialize cache with configuration
107
+ cache = BiocFileCache(config=config)
108
+ ```
109
+
110
+ ### Resource Management
111
+
112
+ ```python
113
+ from datetime import datetime, timedelta, timezone
114
+
115
+ # Add file with expiration
116
+ resource = cache.add(
117
+ "myfile",
118
+ "path/to/file.txt",
119
+ expires=datetime.now(timezone.utc) + timedelta(days=30),
120
+ )
121
+
122
+ # Immediate lookup without waiting on missing files
123
+ record = cache.get(rid="BFC1", wait=False)
124
+
125
+ # List resources
126
+ resources = cache.list_resources()
127
+
128
+ # Search resources (exact or substring match)
129
+ results = cache.search("myfile", field="rname")
130
+
131
+ # Update resource by name or rid
132
+ cache.update("myfile", "path/to/new_file.txt")
133
+ cache.update(rid="BFC1", fpath="path/to/new_file.txt")
134
+
135
+ # Remove resource by name or rid
136
+ cache.remove("myfile")
137
+ ```
138
+
139
+ ### Cache Statistics and Maintenance
140
+
141
+ ```python
142
+ # Get cache statistics
143
+ stats = cache.get_stats()
144
+ print(stats)
145
+
146
+ # Clean up expired resources
147
+ removed_count = cache.cleanup()
148
+
149
+ # Verify integrity of cached files
150
+ valid, invalid = cache.verify_cache()
151
+
152
+ # Purge entire cache
153
+ cache.purge()
59
154
  ```
@@ -0,0 +1,99 @@
1
+ [![PyPI-Server](https://img.shields.io/pypi/v/pyBiocFileCache.svg)](https://pypi.org/project/pyBiocFileCache/)
2
+ ![Unit tests](https://github.com/BiocPy/pybiocfilecache/actions/workflows/run-tests.yml/badge.svg)
3
+ ![R and Python Interop](https://github.com/BiocPy/pybiocfilecache/actions/workflows/r-interop-tests.yml/badge.svg)
4
+
5
+ # pyBiocFileCache
6
+
7
+ `pyBiocFileCache` is a Python package that provides a file caching system with resource validation, expiration management, and SQLite-backed metadata. Compatible with the [BiocFileCache R package](https://github.com/Bioconductor/BiocFileCache).
8
+
9
+ ## Installation
10
+
11
+ Install from [PyPI](https://pypi.org/project/pyBiocFileCache/):
12
+
13
+ ```bash
14
+ pip install pybiocfilecache
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```python
20
+ from pybiocfilecache import BiocFileCache
21
+
22
+ # Initialize cache
23
+ cache = BiocFileCache("path/to/cache/directory")
24
+
25
+ # Add a file to cache
26
+ resource = cache.add("myfile", "path/to/file.txt")
27
+
28
+ # Retrieve a file from cache
29
+ resource = cache.get("myfile")
30
+
31
+ # Use the cached file
32
+ print(resource["rpath"]) # Path to cached file
33
+ ```
34
+
35
+ ## Advanced Usage
36
+
37
+ ### Configuration
38
+
39
+ ```python
40
+ from datetime import timedelta
41
+ from pathlib import Path
42
+
43
+ from pybiocfilecache import BiocFileCache, CacheConfig
44
+
45
+ # Create custom configuration
46
+ config = CacheConfig(
47
+ cache_dir=Path("cache_directory"),
48
+ cleanup_interval=timedelta(days=7),
49
+ )
50
+
51
+ # Initialize cache with configuration
52
+ cache = BiocFileCache(config=config)
53
+ ```
54
+
55
+ ### Resource Management
56
+
57
+ ```python
58
+ from datetime import datetime, timedelta, timezone
59
+
60
+ # Add file with expiration
61
+ resource = cache.add(
62
+ "myfile",
63
+ "path/to/file.txt",
64
+ expires=datetime.now(timezone.utc) + timedelta(days=30),
65
+ )
66
+
67
+ # Immediate lookup without waiting on missing files
68
+ record = cache.get(rid="BFC1", wait=False)
69
+
70
+ # List resources
71
+ resources = cache.list_resources()
72
+
73
+ # Search resources (exact or substring match)
74
+ results = cache.search("myfile", field="rname")
75
+
76
+ # Update resource by name or rid
77
+ cache.update("myfile", "path/to/new_file.txt")
78
+ cache.update(rid="BFC1", fpath="path/to/new_file.txt")
79
+
80
+ # Remove resource by name or rid
81
+ cache.remove("myfile")
82
+ ```
83
+
84
+ ### Cache Statistics and Maintenance
85
+
86
+ ```python
87
+ # Get cache statistics
88
+ stats = cache.get_stats()
89
+ print(stats)
90
+
91
+ # Clean up expired resources
92
+ removed_count = cache.cleanup()
93
+
94
+ # Verify integrity of cached files
95
+ valid, invalid = cache.verify_cache()
96
+
97
+ # Purge entire cache
98
+ cache.purge()
99
+ ```
@@ -1,4 +0,0 @@
1
- ```{include} ../README.md
2
- :relative-docs: docs/
3
- :relative-images:
4
- ```
File without changes