pyBiocFileCache 0.3.1__py3-none-any.whl → 0.5.1__py3-none-any.whl

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.
@@ -2,3 +2,4 @@
2
2
 
3
3
  * Jayaram Kancherla <jayaram.kancherla@gmail.com>
4
4
  * Max Hargreaves <max_hargreaves@outlook.com>
5
+ * Oleksandr Khoroshevskyi <khorosh@virginia.edu>
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyBiocFileCache
3
+ Version: 0.5.1
4
+ Summary: File based cache for resources and metadata
5
+ Home-page: https://github.com/epiviz/pyBiocFileCache
6
+ Author: jkanche
7
+ Author-email: jayaram.kancherla@gmail.com
8
+ License: MIT
9
+ Project-URL: Documentation, https://pyscaffold.org/
10
+ Platform: any
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Programming Language :: Python
13
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
+ License-File: LICENSE.txt
15
+ License-File: AUTHORS.md
16
+ Requires-Dist: importlib-metadata; python_version < "3.8"
17
+ Requires-Dist: sqlalchemy
18
+ Provides-Extra: testing
19
+ Requires-Dist: setuptools; extra == "testing"
20
+ Requires-Dist: pytest; extra == "testing"
21
+ Requires-Dist: pytest-cov; extra == "testing"
22
+
23
+ [![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/)
24
+ [![PyPI-Server](https://img.shields.io/pypi/v/pyBiocFileCache.svg)](https://pypi.org/project/pyBiocFileCache/)
25
+ ![Unit tests](https://github.com/BiocPy/pyBiocFileCache/actions/workflows/pypi-test.yml/badge.svg)
26
+
27
+ # pyBiocFileCache
28
+
29
+ `pyBiocFileCache` is a Python package that provides a robust file caching system with resource validation, cache size management, file compression, and resource tagging. Compatible with [BiocFileCache R package](https://github.com/Bioconductor/BiocFileCache).
30
+
31
+ ## Installation
32
+
33
+ Install from [PyPI](https://pypi.org/project/pyBiocFileCache/),
34
+
35
+ ```bash
36
+ pip install pybiocfilecache
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ ```python
42
+ from pybiocfilecache import BiocFileCache
43
+
44
+ # Initialize cache
45
+ cache = BiocFileCache("path/to/cache/directory")
46
+
47
+ # Add a file to cache
48
+ resource = cache.add("myfile", "path/to/file.txt")
49
+
50
+ # Retrieve a file from cache
51
+ resource = cache.get("myfile")
52
+
53
+ # Use the cached file
54
+ print(resource.rpath) # Path to cached file
55
+ ```
56
+
57
+ ## Advanced Usage
58
+
59
+ ### Configuration
60
+
61
+ ```python
62
+ from pybiocfilecache import BiocFileCache, CacheConfig
63
+ from datetime import timedelta
64
+ from pathlib import Path
65
+
66
+ # Create custom configuration
67
+ config = CacheConfig(
68
+ cache_dir=Path("cache_directory"),
69
+ max_size_bytes=1024 * 1024 * 1024, # 1GB
70
+ cleanup_interval=timedelta(days=7),
71
+ compression=True
72
+ )
73
+
74
+ # Initialize cache with configuration
75
+ cache = BiocFileCache(config=config)
76
+ ```
77
+
78
+ ### Resource Management
79
+
80
+ ```python
81
+ # Add file with tags and expiration
82
+ from datetime import datetime, timedelta
83
+
84
+ resource = cache.add(
85
+ "myfile",
86
+ "path/to/file.txt",
87
+ tags=["data", "raw"],
88
+ expires=datetime.now() + timedelta(days=30)
89
+ )
90
+
91
+ # List resources by tag
92
+ resources = cache.list_resources(tag="data")
93
+
94
+ # Search resources
95
+ results = cache.search("myfile", field="rname")
96
+
97
+ # Update resource
98
+ cache.update("myfile", "path/to/new_file.txt")
99
+
100
+ # Remove resource
101
+ cache.remove("myfile")
102
+ ```
103
+
104
+ ### Cache Statistics and Maintenance
105
+
106
+ ```python
107
+ # Get cache statistics
108
+ stats = cache.get_stats()
109
+ print(stats)
110
+
111
+ # Clean up expired resources
112
+ removed_count = cache.cleanup()
113
+
114
+ # Purge entire cache
115
+ cache.purge()
116
+ ```
@@ -0,0 +1,13 @@
1
+ pybiocfilecache/__init__.py,sha256=kClwDkzgGPYAyDW-fuo5LI4lKCruYJhDHvw0lq9u4b0,652
2
+ pybiocfilecache/cache.py,sha256=YOCur7R7209WBI6JEW3Q9VzD7ymu7Wj2DDLGEMFCeDo,21395
3
+ pybiocfilecache/config.py,sha256=hfknpMCzNk6wt84lTvbfH3Z0g66u_-2Fer3AftgDJBA,1040
4
+ pybiocfilecache/const.py,sha256=c9167eSCGBp0wF1xuAEvr-fbYCzp0lcOtKF9sqxlLF8,26
5
+ pybiocfilecache/exceptions.py,sha256=8jrnctFYF7Rc1xsITtLUwKKvx8GMoKbarucyc-4f2zI,706
6
+ pybiocfilecache/models.py,sha256=A6BIrT78qqURxJoDvBjkDRBFV5cLdi3WKxreSCPB9tw,2125
7
+ pybiocfilecache/utils.py,sha256=lBK4BmzT6Z7XCn4j8kmhz9BPQpWT-RYfWvWC7YNtIGM,2291
8
+ pyBiocFileCache-0.5.1.dist-info/AUTHORS.md,sha256=ptvMLokf9Knfp0Ng-dHSgtEimkXWZhjZAR_o2aJm9bw,161
9
+ pyBiocFileCache-0.5.1.dist-info/LICENSE.txt,sha256=bV5MJ4ezdCnC4yREyxU30iel5hFq8T8kGqobu4Kc-WM,1082
10
+ pyBiocFileCache-0.5.1.dist-info/METADATA,sha256=N1hNP2VEuDt-u2maLQW9b5qmS7llNtkKgGUusWNpolU,2991
11
+ pyBiocFileCache-0.5.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
12
+ pyBiocFileCache-0.5.1.dist-info/top_level.txt,sha256=_A2QFmYMnsz6WoSRPk1EFMDr5mkQVGx9Xtz2RMv3aF4,16
13
+ pyBiocFileCache-0.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -15,11 +15,5 @@ except PackageNotFoundError: # pragma: no cover
15
15
  finally:
16
16
  del version, PackageNotFoundError
17
17
 
18
- from .BiocFileCache import BiocFileCache as BiocFileCache
19
-
20
- from .db.schema import Metadata as Metadata
21
- from .db.schema import Resource as Resource
22
-
23
- from ._exceptions import NoFpathError as NoFpathError
24
- from ._exceptions import RnameExistsError as RnameExistsError
25
- from ._exceptions import RpathTimeoutError as RpathTimeoutError
18
+ from .cache import BiocFileCache
19
+ from .config import CacheConfig