datamaestro 1.5.1__py3-none-any.whl → 1.5.2__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.
datamaestro/__init__.py CHANGED
@@ -10,4 +10,4 @@ from .context import (
10
10
  from pkg_resources import get_distribution, DistributionNotFound
11
11
  from .definitions import dataset, metadata
12
12
  from .data import Base
13
- from .version import version, version_tuple
13
+ from .version import __version__
datamaestro/__main__.py CHANGED
File without changes
datamaestro/context.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from pathlib import Path
2
- from typing import Iterable, Iterator, Dict, Union
2
+ from typing import Iterable, Iterator, Dict, Optional, Union
3
3
  import importlib
4
4
  import os
5
5
  import hashlib
@@ -423,16 +423,23 @@ def find_dataset(dataset_id: str):
423
423
  return AbstractDataset.find(dataset_id)
424
424
 
425
425
 
426
- def prepare_dataset(dataset_id: Union[str, "DatasetWrapper", Config]):
426
+ def prepare_dataset(
427
+ dataset_id: Union[str, "DatasetWrapper", Config],
428
+ context: Optional[Union[Context, Path]] = None,
429
+ ):
427
430
  """Find a dataset given its id and download the resources"""
428
431
  from .definitions import AbstractDataset, DatasetWrapper
429
432
 
433
+ match context:
434
+ case Path() | str():
435
+ context = Context(Path(context))
436
+
430
437
  if isinstance(dataset_id, DatasetWrapper):
431
438
  ds = dataset_id
432
439
  elif isinstance(dataset_id, Config):
433
440
  ds = dataset_id.__datamaestro_dataset__
434
441
  else:
435
- ds = AbstractDataset.find(dataset_id)
442
+ ds = AbstractDataset.find(dataset_id, context=context)
436
443
 
437
444
  return ds.prepare(download=True)
438
445
 
@@ -236,10 +236,12 @@ class AbstractDataset(AbstractData):
236
236
  return success
237
237
 
238
238
  @staticmethod
239
- def find(name: str) -> "DataDefinition":
239
+ def find(name: str, context: Optional["Context"] = None) -> "DataDefinition":
240
240
  """Find a dataset given its name"""
241
241
  from datamaestro.context import Context # noqa: F811
242
242
 
243
+ context = Context.instance() if context is None else context
244
+
243
245
  logging.debug("Searching dataset %s", name)
244
246
  for repository in Context.instance().repositories():
245
247
  logging.debug("Searching dataset %s in %s", name, repository)
datamaestro/version.py CHANGED
@@ -1,21 +1,4 @@
1
- # file generated by setuptools-scm
2
- # don't change, don't track in version control
3
-
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
-
6
- TYPE_CHECKING = False
7
- if TYPE_CHECKING:
8
- from typing import Tuple
9
- from typing import Union
10
-
11
- VERSION_TUPLE = Tuple[Union[int, str], ...]
12
- else:
13
- VERSION_TUPLE = object
14
-
15
- version: str
16
- __version__: str
17
- __version_tuple__: VERSION_TUPLE
18
- version_tuple: VERSION_TUPLE
19
-
20
- __version__ = version = '1.5.1'
21
- __version_tuple__ = version_tuple = (1, 5, 1)
1
+ # This file is auto-generated by Hatchling. As such, do not:
2
+ # - modify
3
+ # - track in version control e.g. be sure to add to .gitignore
4
+ __version__ = VERSION = '1.5.2'
@@ -1,42 +1,31 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datamaestro
3
- Version: 1.5.1
4
- Summary: "Dataset management command line and API"
5
- Home-page: https://github.com/experimaestro/datamaestro
6
- Author: Benjamin Piwowarski
7
- Author-email: benjamin@piwowarski.fr
8
- License: GPL-3
9
- Keywords: dataset manager
10
- Platform: any
3
+ Version: 1.5.2
4
+ Summary: Add your description here
5
+ Author-email: Benjamin Piwowarski <benjamin@piwowarski.fr>
6
+ License-File: LICENSE
11
7
  Classifier: Development Status :: 4 - Beta
12
8
  Classifier: Intended Audience :: Science/Research
13
9
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
10
  Classifier: Operating System :: OS Independent
15
11
  Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3
19
13
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Requires-Python: >=3.8
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
- Requires-Dist: click
24
- Requires-Dist: tqdm
25
- Requires-Dist: urllib3
26
- Requires-Dist: marshmallow
27
- Requires-Dist: cached_property
28
- Requires-Dist: requests
29
- Requires-Dist: bitmath
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: bitmath>=1.3.3.1
16
+ Requires-Dist: cached-property>=2.0.1
17
+ Requires-Dist: click>=8.2.1
18
+ Requires-Dist: docstring-parser>=0.16
30
19
  Requires-Dist: experimaestro>=1.8.9
31
- Requires-Dist: mkdocs
32
- Requires-Dist: pymdown-extensions
33
- Requires-Dist: mkdocs-material
34
- Requires-Dist: docstring_parser
20
+ Requires-Dist: marshmallow>=3.26.1
21
+ Requires-Dist: mkdocs-material>=9.6.15
22
+ Requires-Dist: mkdocs>=1.6.1
35
23
  Requires-Dist: numpy
36
- Provides-Extra: test
37
- Requires-Dist: tox; extra == "test"
38
- Dynamic: license-file
39
- Dynamic: requires-dist
24
+ Requires-Dist: pymdown-extensions>=10.16
25
+ Requires-Dist: requests>=2.32.4
26
+ Requires-Dist: tqdm>=4.67.1
27
+ Requires-Dist: urllib3>=2.5.0
28
+ Description-Content-Type: text/markdown
40
29
 
41
30
  [![PyPI version](https://badge.fury.io/py/datamaestro.svg)](https://badge.fury.io/py/datamaestro) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![DOI](https://zenodo.org/badge/4573876.svg)](https://zenodo.org/badge/latestdoi/4573876)
42
31
 
@@ -192,22 +181,3 @@ This will allow to
192
181
 
193
182
  1. Document the dataset
194
183
  2. Allow to use the command line interface to manipulate it (download resources, etc.)
195
-
196
- # 0.8.0
197
-
198
- - Integration with other repositories: abstracting away the notion of dataset
199
- - Repository prefix
200
- - Set sub-datasets IDs automatically
201
-
202
- # 0.7.3
203
-
204
- - Updates for new experimaestro (0.8.5)
205
- - Search types with "type:..."
206
-
207
- # 0.6.17
208
-
209
- - Allow remote access through rpyc
210
-
211
- # 0.6.9
212
-
213
- `version` command
@@ -1,14 +1,14 @@
1
- datamaestro/__init__.py,sha256=LR8nx7H3Fo97O0gJXV2PxQezsmSTDLAg_nQEXB5QAjc,322
1
+ datamaestro/__init__.py,sha256=WA9Jrikg-1GcQ6TRezV0qBAv7wQfsfRLdtBwzEWQE6Q,311
2
2
  datamaestro/__main__.py,sha256=2p36ZcJcZAL9NZBUkMaYRUhKyqhheVPXMGw6K1KNwhk,9196
3
- datamaestro/context.py,sha256=KsXYNTt4xX4zEVrnd2hciP7PVCh1StRzjU1Ih6VeCtU,13532
4
- datamaestro/definitions.py,sha256=FiM_WZhF91f1H2c8ZardEV9jw5R-4zlkFWmzuTGQxos,19705
3
+ datamaestro/context.py,sha256=kVbChQy2Nr7Z0Jz9Qbz8AC-XCAIes50SIpROwez910k,13712
4
+ datamaestro/definitions.py,sha256=-9rKgFxqn103HslqWLovq4EdoSkJmx9FNTKneLGBfTo,19812
5
5
  datamaestro/record.py,sha256=IxxcrSIf99iluohtpnuMBTFkqeHRe5S-T_hWEqBgeME,5812
6
6
  datamaestro/registry.py,sha256=M7QJkcWJP_cxAoqIioLQ01ou2Zg9RqGQvW0XGVspYFE,1421
7
7
  datamaestro/search.py,sha256=bRT-91-2VJJ2JSfNaS1mzaVfqq_HMVBVs-RBj0w-ypM,2906
8
8
  datamaestro/settings.py,sha256=HYSElTUYZ6DZocBb9o3ifm6WW9knRO64XJUwxGIpvwQ,1304
9
9
  datamaestro/sphinx.py,sha256=bp7x_2BFoTSwTqcVZDM8R8cWa7G2pz0Zb8GS054lLYM,6996
10
10
  datamaestro/utils.py,sha256=9m-AVVww6InAZfGFiGy6XJzfExpYNqH1fhWQEezjafA,6536
11
- datamaestro/version.py,sha256=FasBapRYrTzegTWgTLGzFg84_c9eAAt8ZkOEeQxlLC4,511
11
+ datamaestro/version.py,sha256=nuWd41kVXDQdWyAwYcshPXgiAAgKAIVDM6QbgRkd4GE,171
12
12
  datamaestro/annotations/__init__.py,sha256=jLprrxSBa5QIqc--vqycEcxU4CR9WjVNRaqR5lH0EuE,39
13
13
  datamaestro/annotations/agreement.py,sha256=xEH0ddZxdJ_oG_150PoOa-WjY_OaeQja3FzMzY5IB6k,955
14
14
  datamaestro/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -40,9 +40,8 @@ datamaestro/test/conftest.py,sha256=it4S5Qq1CA_U8qM0pr4m7v-1dhLj5Y49WjVg5Ee3mpM,
40
40
  datamaestro/test/test_annotations.py,sha256=XUjDWb3FJimSD91wcItJ0lLwTBmvN4wVu_EgTKSvV2c,278
41
41
  datamaestro/test/test_download_handlers.py,sha256=-Gofr89zqIyeI8C4rZqfYR3JfiZVImdcSz9s6q361zQ,641
42
42
  datamaestro/test/test_record.py,sha256=hNZ3uo2i5FZ0VsOHRwvLO1Z6Zce92PdipAF65UptPB8,1156
43
- datamaestro-1.5.1.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
44
- datamaestro-1.5.1.dist-info/METADATA,sha256=r0FpdXB_X6gXcy3hdBDq06N1lP-6DN-RQ_65tYjRixc,8191
45
- datamaestro-1.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- datamaestro-1.5.1.dist-info/entry_points.txt,sha256=8qMhwSRvFG2iBqtJYVD22Zd4s4c3YkODtcp0Ajw1knw,133
47
- datamaestro-1.5.1.dist-info/top_level.txt,sha256=XSznaMNAA8jELV7-TOqaAgDsjLzUf9G9MxL7C4helT0,12
48
- datamaestro-1.5.1.dist-info/RECORD,,
43
+ datamaestro-1.5.2.dist-info/METADATA,sha256=hHB6tXBNZjirZXG7II5ff3bovHhoig1I51JGIImnHkw,7635
44
+ datamaestro-1.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
45
+ datamaestro-1.5.2.dist-info/entry_points.txt,sha256=8qMhwSRvFG2iBqtJYVD22Zd4s4c3YkODtcp0Ajw1knw,133
46
+ datamaestro-1.5.2.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
47
+ datamaestro-1.5.2.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1 +0,0 @@
1
- datamaestro