pyBiocFileCache 0.2.2__py3-none-any.whl → 0.3.0__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.
- {pyBiocFileCache-0.2.2.dist-info → pyBiocFileCache-0.3.0.dist-info}/AUTHORS.md +1 -1
- {pyBiocFileCache-0.2.2.dist-info → pyBiocFileCache-0.3.0.dist-info}/METADATA +7 -3
- pyBiocFileCache-0.3.0.dist-info/RECORD +13 -0
- {pyBiocFileCache-0.2.2.dist-info → pyBiocFileCache-0.3.0.dist-info}/WHEEL +1 -1
- pybiocfilecache/BiocFileCache.py +10 -8
- pybiocfilecache/db/Base.py +1 -1
- pybiocfilecache/db/schema.py +0 -1
- pybiocfilecache/utils.py +2 -2
- pyBiocFileCache-0.2.2.dist-info/RECORD +0 -13
- {pyBiocFileCache-0.2.2.dist-info → pyBiocFileCache-0.3.0.dist-info}/LICENSE.txt +0 -0
- {pyBiocFileCache-0.2.2.dist-info → pyBiocFileCache-0.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyBiocFileCache
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: File based cache for resources and metadata
|
|
5
5
|
Home-page: https://github.com/epiviz/pyBiocFileCache
|
|
6
6
|
Author: jkanche
|
|
@@ -13,13 +13,17 @@ Classifier: Programming Language :: Python
|
|
|
13
13
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
14
14
|
License-File: LICENSE.txt
|
|
15
15
|
License-File: AUTHORS.md
|
|
16
|
-
Requires-Dist: sqlalchemy
|
|
16
|
+
Requires-Dist: sqlalchemy <2.1,>=2
|
|
17
17
|
Requires-Dist: importlib-metadata ; python_version < "3.8"
|
|
18
18
|
Provides-Extra: testing
|
|
19
19
|
Requires-Dist: setuptools ; extra == 'testing'
|
|
20
20
|
Requires-Dist: pytest ; extra == 'testing'
|
|
21
21
|
Requires-Dist: pytest-cov ; extra == 'testing'
|
|
22
22
|
|
|
23
|
+
[](https://pyscaffold.org/)
|
|
24
|
+
[](https://pypi.org/project/pyBiocFileCache/)
|
|
25
|
+

|
|
26
|
+
|
|
23
27
|
# pyBiocFileCache
|
|
24
28
|
|
|
25
29
|
File system based cache for resources & metadata. Compatible with [BiocFileCache R package](https://github.com/Bioconductor/BiocFileCache)
|
|
@@ -34,7 +38,7 @@ Package is published to [PyPI](https://pypi.org/project/pyBiocFileCache/)
|
|
|
34
38
|
pip install pybiocfilecache
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
#### Initialize a cache directory
|
|
41
|
+
#### Initialize a cache directory
|
|
38
42
|
|
|
39
43
|
```
|
|
40
44
|
from pybiocfilecache import BiocFileCache
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pybiocfilecache/BiocFileCache.py,sha256=6L7uYANBSPkb6kEX8p-VYHCLOPPn4RUIveFDktSzXrI,8130
|
|
2
|
+
pybiocfilecache/__init__.py,sha256=5SUhxaA5370FRyHOs5miL4WXxe2fNODbO_I6VRqDCB0,915
|
|
3
|
+
pybiocfilecache/_exceptions.py,sha256=347Lt1Rrt-TTzP5yEqlRM1QoaPBXB1UnZXv0GfhZmv0,374
|
|
4
|
+
pybiocfilecache/utils.py,sha256=NHgigiMzZ3LaQPDa2ydAH1f8ls4itZgCRbcB2qJwyjA,1783
|
|
5
|
+
pybiocfilecache/db/Base.py,sha256=TuMk8Eqiu8rb7QZVtUYsGbVxMekn4UDyQ4vkvuCp22k,939
|
|
6
|
+
pybiocfilecache/db/__init__.py,sha256=XE1DrTqLmDOM4Y4Qt3fdr6ahir5Vqug5e5v-DQexCDw,102
|
|
7
|
+
pybiocfilecache/db/schema.py,sha256=alr2YCfCmYb7xt8pzXqwpY-eBLNA3oR4nD8ruVzHo6E,1041
|
|
8
|
+
pyBiocFileCache-0.3.0.dist-info/AUTHORS.md,sha256=MMx3vll5oIcyk72Bk3N_ACfHWt5YhAlk2vBjx68m4R8,112
|
|
9
|
+
pyBiocFileCache-0.3.0.dist-info/LICENSE.txt,sha256=bV5MJ4ezdCnC4yREyxU30iel5hFq8T8kGqobu4Kc-WM,1082
|
|
10
|
+
pyBiocFileCache-0.3.0.dist-info/METADATA,sha256=aBtQrklvKx2djCoo6ATN5D8V0ptkSyR0dLT4HfiXg6o,2535
|
|
11
|
+
pyBiocFileCache-0.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
12
|
+
pyBiocFileCache-0.3.0.dist-info/top_level.txt,sha256=_A2QFmYMnsz6WoSRPk1EFMDr5mkQVGx9Xtz2RMv3aF4,16
|
|
13
|
+
pyBiocFileCache-0.3.0.dist-info/RECORD,,
|
pybiocfilecache/BiocFileCache.py
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Python Implementation of BiocFileCache
|
|
3
|
-
"""
|
|
1
|
+
"""Python Implementation of BiocFileCache."""
|
|
4
2
|
|
|
5
3
|
import os
|
|
6
4
|
from pathlib import Path
|
|
@@ -21,9 +19,7 @@ __license__ = "MIT"
|
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
class BiocFileCache:
|
|
24
|
-
"""
|
|
25
|
-
Class to manage and cache files.
|
|
26
|
-
"""
|
|
22
|
+
"""Class to manage and cache files."""
|
|
27
23
|
|
|
28
24
|
def __init__(self, cacheDirOrPath: Union[str, Path] = create_tmp_dir()):
|
|
29
25
|
"""Initialize BiocFileCache.
|
|
@@ -90,7 +86,13 @@ class BiocFileCache:
|
|
|
90
86
|
|
|
91
87
|
# create new record in the database
|
|
92
88
|
res = Resource(
|
|
93
|
-
**dict(
|
|
89
|
+
**dict(
|
|
90
|
+
rid=rid,
|
|
91
|
+
rname=rname,
|
|
92
|
+
rpath=rpath,
|
|
93
|
+
rtype=rtype,
|
|
94
|
+
fpath=str(fpath),
|
|
95
|
+
)
|
|
94
96
|
)
|
|
95
97
|
|
|
96
98
|
# If this was higher up a parallel process could have added the key to
|
|
@@ -164,7 +166,7 @@ class BiocFileCache:
|
|
|
164
166
|
return resource
|
|
165
167
|
|
|
166
168
|
def get(self, rname: str) -> Optional[Resource]:
|
|
167
|
-
"""
|
|
169
|
+
"""Get resource by name from cache.
|
|
168
170
|
|
|
169
171
|
Args:
|
|
170
172
|
rname (str): Name of the file to search.
|
pybiocfilecache/db/Base.py
CHANGED
|
@@ -13,7 +13,7 @@ Base = declarative_base()
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def create_schema(cache_dir: str) -> Tuple[Engine, sessionmaker]:
|
|
16
|
-
"""Create the schema in the sqlite database
|
|
16
|
+
"""Create the schema in the sqlite database.
|
|
17
17
|
|
|
18
18
|
Args:
|
|
19
19
|
cache_dir (str): Location where the cache directory
|
pybiocfilecache/db/schema.py
CHANGED
pybiocfilecache/utils.py
CHANGED
|
@@ -9,7 +9,7 @@ import sys
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def create_tmp_dir() -> str:
|
|
12
|
-
"""
|
|
12
|
+
"""Create a temporary directory.
|
|
13
13
|
|
|
14
14
|
Returns:
|
|
15
15
|
str: path to the directory
|
|
@@ -57,7 +57,7 @@ def copy_or_move(
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
def setup_logging(loglevel):
|
|
60
|
-
"""Setup basic logging
|
|
60
|
+
"""Setup basic logging.
|
|
61
61
|
|
|
62
62
|
Args:
|
|
63
63
|
loglevel (int): minimum loglevel for emitting messages
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
pybiocfilecache/BiocFileCache.py,sha256=FzU4RI5n9_lLmbvQUH-1iZNJVXjZK02ZUYAuUhMn3lE,8047
|
|
2
|
-
pybiocfilecache/__init__.py,sha256=5SUhxaA5370FRyHOs5miL4WXxe2fNODbO_I6VRqDCB0,915
|
|
3
|
-
pybiocfilecache/_exceptions.py,sha256=347Lt1Rrt-TTzP5yEqlRM1QoaPBXB1UnZXv0GfhZmv0,374
|
|
4
|
-
pybiocfilecache/utils.py,sha256=HL_VagKHu2HlwT8ODID43ESOD1ERqSwDOGeQHHe8-YA,1782
|
|
5
|
-
pybiocfilecache/db/Base.py,sha256=vfOWyRKFqPj4L4esuWb0MeCGu04xAz5bhAI1nl8IGjU,938
|
|
6
|
-
pybiocfilecache/db/__init__.py,sha256=XE1DrTqLmDOM4Y4Qt3fdr6ahir5Vqug5e5v-DQexCDw,102
|
|
7
|
-
pybiocfilecache/db/schema.py,sha256=7Qx6mUw5LeJYwZqikIox_H429Ko24mHYz7vey4zLUrA,1042
|
|
8
|
-
pyBiocFileCache-0.2.2.dist-info/AUTHORS.md,sha256=j3yqoTV-_uShE0VwsxvcmANNhbMdudixmiBL-5cUCFo,111
|
|
9
|
-
pyBiocFileCache-0.2.2.dist-info/LICENSE.txt,sha256=bV5MJ4ezdCnC4yREyxU30iel5hFq8T8kGqobu4Kc-WM,1082
|
|
10
|
-
pyBiocFileCache-0.2.2.dist-info/METADATA,sha256=qCr7P3VRNAhoLd0yN8eqS72-uE7ybeyyfI_k6vZTxPM,2200
|
|
11
|
-
pyBiocFileCache-0.2.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
12
|
-
pyBiocFileCache-0.2.2.dist-info/top_level.txt,sha256=_A2QFmYMnsz6WoSRPk1EFMDr5mkQVGx9Xtz2RMv3aF4,16
|
|
13
|
-
pyBiocFileCache-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|