metahq-core 0.1.0__py3-none-any.whl → 0.1.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.
metahq_core/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.1.2"
@@ -12,9 +12,11 @@ The values of these DataFrames answer the following questions with a
12
12
  Author: Parker Hicks
13
13
  Date: 2025-11-17
14
14
 
15
- Last updated: 2025-11-17 by Parker Hicks
15
+ Last updated: 2025-11-21 by Parker Hicks
16
16
  """
17
17
 
18
+ from pathlib import Path
19
+
18
20
  import polars as pl
19
21
 
20
22
  from metahq_core.logger import setup_logger
@@ -33,11 +35,11 @@ class RelationsLoader:
33
35
 
34
36
  """
35
37
 
36
- def __init__(self, file, logger=None, loglevel=20):
38
+ def __init__(self, file, logger=None, loglevel=20, logdir=Path(".")):
37
39
  self.relations: pl.LazyFrame = self.setup(file)
38
40
 
39
41
  if logger is None:
40
- logger = setup_logger(__name__, level=loglevel)
42
+ logger = setup_logger(__name__, level=loglevel, log_dir=logdir)
41
43
  self.logger = logger
42
44
 
43
45
  def setup(self, file) -> pl.LazyFrame:
@@ -1,13 +1,15 @@
1
1
  """
2
2
  This script stores file path constants and functions to retrieve those paths.
3
3
 
4
+ Functions beginning with an underscore are intended to be called through the
5
+ `supported` function or are just helpers.
6
+
4
7
  Author: Parker Hicks
5
8
  Date: 2025-04-15
6
9
 
7
- Last updated: 2025-11-21 by Parker Hicks
10
+ Last updated: 2025-11-24 by Parker Hicks
8
11
  """
9
12
 
10
- import sys
11
13
  from pathlib import Path
12
14
  from typing import Literal
13
15
 
@@ -53,13 +55,23 @@ def _ecodes() -> dict[str, str]:
53
55
  }
54
56
 
55
57
 
58
+ def _formats() -> list[str]:
59
+ """Returns supported save formats."""
60
+ return ["parquet", "tsv", "csv", "json"]
61
+
62
+
56
63
  def _levels() -> list[str]:
57
64
  """Return supported annotation levels."""
58
65
  return ["sample", "series"]
59
66
 
60
67
 
68
+ def _log_levels() -> list[str]:
69
+ """Return supported logger levels."""
70
+ return ["notset", "debug", "info", "warning", "error", "critical"]
71
+
72
+
61
73
  def _modes() -> list[str]:
62
- return ["direct", "propagate", "label"]
74
+ return ["annotate", "label"]
63
75
 
64
76
 
65
77
  # tmp fix. Need to find out why these are included in anno
@@ -101,7 +113,7 @@ def _technologies() -> list[str]:
101
113
  return ["microarray", "rnaseq"]
102
114
 
103
115
 
104
- def age_groups() -> list[str]:
116
+ def _age_groups() -> list[str]:
105
117
  """Return supported age groups."""
106
118
  return [
107
119
  "fetus",
@@ -163,7 +175,7 @@ def get_config_file():
163
175
 
164
176
 
165
177
  def get_config_file_no_check():
166
- """Only used to intialize MetaHQ."""
178
+ """Only used to initialize MetaHQ."""
167
179
  return get_metahq_home() / "config.yaml"
168
180
 
169
181
 
@@ -182,7 +194,7 @@ def get_log_dir() -> Path:
182
194
  return get_config()["logs"]
183
195
 
184
196
 
185
- def get_default_log_dir():
197
+ def get_default_log_dir() -> Path:
186
198
  """Returns path to default logging directory."""
187
199
  return get_metahq_home()
188
200
 
@@ -365,7 +377,9 @@ def _supported() -> dict[str, list[str]]:
365
377
  """Returns mapping between all supported entities and their items."""
366
378
  return {
367
379
  "attributes": _attributes(),
380
+ "age_groups": _age_groups(),
368
381
  "ecodes": list(_ecodes().keys()),
382
+ "formats": _formats(),
369
383
  "levels": _levels(),
370
384
  "modes": _modes(),
371
385
  "ontologies": _ontologies(),
@@ -373,6 +387,7 @@ def _supported() -> dict[str, list[str]]:
373
387
  "series_metadata": _series_metadata(),
374
388
  "species": list(species_map().keys()),
375
389
  "technologies": _technologies(),
390
+ "log_levels": _log_levels(),
376
391
  }
377
392
 
378
393
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metahq-core
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Core API for the meta-hq CLI.
5
5
  Author-email: Parker Hicks <parker.hicks@cuanschutz.edu>, Faisal Alquaddoomi <faisal.alquaddoomi@cuanschutz.edu>
6
- Keywords: cli,core,tool
6
+ Keywords: CLI,Data Curation,Database,Public Biomedical Data
7
7
  Classifier: Development Status :: 3 - Alpha
8
8
  Classifier: Intended Audience :: Science/Research
9
9
  Classifier: Operating System :: OS Independent
@@ -32,3 +32,20 @@ Provides-Extra: test
32
32
  Requires-Dist: pytest-benchmark; extra == 'test'
33
33
  Requires-Dist: pytest-cov; extra == 'test'
34
34
  Requires-Dist: pytest>=8.0; extra == 'test'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # metahq-core
38
+
39
+ ![Core Tests](https://github.com/krishnanlab/meta-hq/workflows/Core%20Tests/badge.svg)
40
+ ![Python](https://img.shields.io/badge/python-3.11+-blue.svg)
41
+ ![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)
42
+ ![pypi](https://img.shields.io/pypi/v/metahq-core.svg)
43
+
44
+ Backend package for `metahq-cli` also available on PyPI. Currently this package
45
+ is solely intended to be used through the MetaHQ CLI.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install metahq-core
51
+ ```
@@ -1,5 +1,5 @@
1
1
  metahq_core/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- metahq_core/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
2
+ metahq_core/__init__.py,sha256=YvuYzWnKtqBb-IqG8HAu-nhIYAsgj9Vmc_b9o7vO-js,22
3
3
  metahq_core/logger.py,sha256=06QrC5msnehVLZ40T8oBFIUrlmBB-ysNiF5zo7Ms4fw,1319
4
4
  metahq_core/query.py,sha256=B8oyh_vKps02QXW3MgBQmZgCK20tdy2bUB4tTmNfBXk,18526
5
5
  metahq_core/search.py,sha256=XEyZqqAIE5GPK-kUw2YQFnntvcsjMmZkAR_xjRJjuYI,9549
@@ -16,7 +16,7 @@ metahq_core/export/labels.py,sha256=pvS5_WIa2Aau7s4rpnSAm7OlD57Ht6Qln8-91GbNNao,
16
16
  metahq_core/ontology/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  metahq_core/ontology/base.py,sha256=DtdIb18aerwi3sX_B6opmkaoSuO_sVEKFTWbEY3MZHg,11545
18
18
  metahq_core/ontology/graph.py,sha256=47S_kfO6h6Np6i2g90Zizehq9yZiE4sXbuZzukyoDVE,8430
19
- metahq_core/ontology/loader.py,sha256=FsjpjfKu2uvPA0p0OOvaWQOVaTTqUnvVVHev42GhMGk,4627
19
+ metahq_core/ontology/loader.py,sha256=epSiBAjiJa2KFe4Tfm3dxtjPcPgxTIHwOpN3VV03iTI,4687
20
20
  metahq_core/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  metahq_core/util/alltypes.py,sha256=zYrBKvtkAhR7lmqDlGp7BOh2bUNI-toQfd7o7isDCxw,721
22
22
  metahq_core/util/checkers.py,sha256=_7Aw2bO1PNg-9TPYOwKwvTqFtmb5vMyYU-omfUID_DE,508
@@ -24,7 +24,7 @@ metahq_core/util/exceptions.py,sha256=FlYUN8g4lNB3OSwQ20dfnSDmgX8NKZV5Yx7xERurrW
24
24
  metahq_core/util/helpers.py,sha256=sak1A7gp2qvnbhCBYHNQ5IUxIZeljgyRSu5U7C8a7bU,949
25
25
  metahq_core/util/io.py,sha256=3JY04VjxuWA1TSx59iIQaON1LG-ZZp2zxSLkuFDoHWg,3075
26
26
  metahq_core/util/progress.py,sha256=NF158KVFO9pO3vrsl7OrPAhYtd-cXaXRavL0iOV5XeM,2128
27
- metahq_core/util/supported.py,sha256=Gx4BRPcThEkapUnoos4DfMBzN55tupZSQSz-2V9W0kQ,10517
28
- metahq_core-0.1.0.dist-info/METADATA,sha256=B_AdZZCACKVjIsR7QUyaC9CeNRu68_YnxS8m0HeNKac,1275
29
- metahq_core-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
- metahq_core-0.1.0.dist-info/RECORD,,
27
+ metahq_core/util/supported.py,sha256=RRMCaNh5xKBL8zNDW_7oR7v0bWRXyhI4FgWmiUH4_i4,10995
28
+ metahq_core-0.1.2.dist-info/METADATA,sha256=lcjV5sxKOWdTV69O1FSgWbVN-fa4DJu7Cy1YcTCT5RI,1836
29
+ metahq_core-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
+ metahq_core-0.1.2.dist-info/RECORD,,