pymetadata 0.5.3__tar.gz → 0.5.4__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.
Potentially problematic release.
This version of pymetadata might be problematic. Click here for more details.
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.bumpversion.toml +1 -1
- pymetadata-0.5.4/.python-version +1 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/PKG-INFO +1 -2
- {pymetadata-0.5.3 → pymetadata-0.5.4}/pyproject.toml +0 -1
- pymetadata-0.5.4/release-notes/0.5.4.md +11 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/__init__.py +1 -1
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/chebi.py +21 -29
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/core/annotation.py +4 -1
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/core/test_annotation.py +5 -0
- pymetadata-0.5.4/uv.lock +1410 -0
- pymetadata-0.5.3/.python-version +0 -1
- pymetadata-0.5.3/src/pymetadata/resources/chebi_webservice_wsdl.xml +0 -509
- pymetadata-0.5.3/uv.lock +0 -1179
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/CONTRIBUTING.rst +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/ISSUE_TEMPLATE/01-bug-report.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/ISSUE_TEMPLATE/02-question.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/ISSUE_TEMPLATE/03-feature-request.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/SUPPORT.rst +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/workflows/main.yml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/workflows/mypy.yml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.github/workflows/ruff.yml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.gitignore +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.pre-commit-config.yaml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.ruff.toml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/.zenodo.json +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/LICENSE +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/README.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/RELEASE.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/composite_annotations.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/about.txt +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/android-chrome-192x192.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/android-chrome-512x512.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/apple-touch-icon.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/favicon-16x16.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/favicon-32x32.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/favicon.ico +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/favicon_io.zip +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/pymetadata-100x100-300dpi.png +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/docs/images/favicon/site.webmanifest +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.10.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.11.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.12.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.13.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.14.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.15.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.16.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.17.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.18.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.19.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.2.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.20.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.21.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.22.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.3.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.4.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.5.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.6.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.7.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.8.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.0.9.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.1.0.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.1.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.10.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.2.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.3.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.4.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.5.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.6.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.7.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.8.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.2.9.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.0.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.1.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.10.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.11.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.2.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.3.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.4.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.5.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.6.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.7.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.8.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.3.9.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.4.0.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.4.1.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.4.2.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.4.3.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.4.4.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.5.0.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.5.1.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.5.2.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/release-notes/0.5.3.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/cache.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/console.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/core/__init__.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/core/creator.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/core/synonym.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/core/xref.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/__init__.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/cache_path_example.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/omex_example.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/test_from_files.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/test_from_omex.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/testomex/README.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/testomex/manifest.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/testomex/models/omex_comp.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/testomex/models/omex_comp_flat.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/results/testomex/models/omex_minimal.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/examples/test.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/identifiers/__init__.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/identifiers/miriam.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/identifiers/registry.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/log.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/metadata/__init__.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/metadata/eco.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/metadata/kisao.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/metadata/sbo.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/omex.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/omex_v2.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/ontologies/__init__.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/ontologies/ols.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/ontologies/ontology.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/py.typed +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/resources/ontologies/README.md +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/resources/templates/ontology_enum.pytemplate +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/src/pymetadata/unichem.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/core/test_creator.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/BIOMD0000000001.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/CombineArchiveShowCase.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/CombineArchiveShowCase_manifest.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/CompModels.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/CompModels_manifest.xml +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/data/omex/iCGB21FR.omex +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_chebi.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_ols.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_omex.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_ontology.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_registry.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_sbo_kisao.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tests/test_unichem.py +0 -0
- {pymetadata-0.5.3 → pymetadata-0.5.4}/tox.ini +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pymetadata
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: pymetadata are python utilities for working with metadata.
|
|
5
5
|
Author-email: Matthias König <konigmatt@googlemail.com>
|
|
6
6
|
Maintainer-email: Matthias König <konigmatt@googlemail.com>
|
|
@@ -27,7 +27,6 @@ Requires-Dist: pydantic>=2.10.4
|
|
|
27
27
|
Requires-Dist: requests>=2.32.3
|
|
28
28
|
Requires-Dist: rich>=13.9.4
|
|
29
29
|
Requires-Dist: xmltodict>=0.14.2
|
|
30
|
-
Requires-Dist: zeep>=4.3.1
|
|
31
30
|
Provides-Extra: dev
|
|
32
31
|
Requires-Dist: bump-my-version>=0.29.0; extra == 'dev'
|
|
33
32
|
Requires-Dist: mypy>=1.9.0; extra == 'dev'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Release notes for pymetadata 0.5.4
|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
We are pleased to release the next version of pymetadata including the
|
|
5
|
+
following changes:
|
|
6
|
+
|
|
7
|
+
## Features & fixes
|
|
8
|
+
- bugfix for annotations with "/"
|
|
9
|
+
- fixing webservices for Chebi 2.0 (#61)
|
|
10
|
+
|
|
11
|
+
Your pymetadata team
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
"""Module for working with chebi."""
|
|
2
2
|
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from pprint import pprint
|
|
5
4
|
from typing import Any, Dict, Optional
|
|
6
|
-
|
|
7
|
-
from zeep import Client
|
|
8
|
-
|
|
5
|
+
import requests
|
|
9
6
|
|
|
10
7
|
import pymetadata
|
|
11
8
|
from pymetadata import log
|
|
12
9
|
from pymetadata.cache import DataclassJSONEncoder, read_json_cache, write_json_cache
|
|
10
|
+
from pymetadata.console import console
|
|
13
11
|
|
|
14
12
|
logger = log.get_logger(__name__)
|
|
15
13
|
|
|
16
|
-
# FIXME: copy the file to the cache dir
|
|
17
|
-
client = Client(str(pymetadata.RESOURCES_DIR / "chebi_webservice_wsdl.xml"))
|
|
18
|
-
|
|
19
14
|
|
|
20
15
|
class ChebiQuery:
|
|
21
|
-
"""Class to query information from ChEBI.
|
|
22
|
-
|
|
23
|
-
An overview over available methods:
|
|
24
|
-
python -mzeep https://www.ebi.ac.uk/webservices/chebi/2.0/webservice?wsdl
|
|
25
|
-
"""
|
|
16
|
+
"""Class to query information from ChEBI."""
|
|
26
17
|
|
|
27
18
|
@staticmethod
|
|
28
19
|
def query(
|
|
@@ -52,27 +43,28 @@ class ChebiQuery:
|
|
|
52
43
|
|
|
53
44
|
# fetch and cache data
|
|
54
45
|
if not data:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
response = requests.get(
|
|
47
|
+
url=f"https://www.ebi.ac.uk/chebi/backend/api/public/compounds/?chebi_ids={chebi}"
|
|
48
|
+
)
|
|
49
|
+
if response.status_code == 200:
|
|
50
|
+
result = response.json()
|
|
51
|
+
else:
|
|
59
52
|
logger.error(f"CHEBI information could not be retrieved for: {chebi}")
|
|
60
53
|
return dict()
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if formulae:
|
|
66
|
-
formula = formulae[0]["data"]
|
|
67
|
-
|
|
55
|
+
result = result[chebi]["data"]
|
|
56
|
+
chemical_data = result["chemical_data"]
|
|
57
|
+
default_structure = result["default_structure"]
|
|
68
58
|
data = {
|
|
69
59
|
"chebi": chebi,
|
|
70
|
-
"name": result["
|
|
60
|
+
"name": result["ascii_name"],
|
|
71
61
|
"definition": result["definition"],
|
|
72
|
-
"formula": formula,
|
|
73
|
-
"charge":
|
|
74
|
-
"mass":
|
|
75
|
-
"inchikey":
|
|
62
|
+
"formula": chemical_data["formula"] if chemical_data else None,
|
|
63
|
+
"charge": chemical_data["charge"] if chemical_data else None,
|
|
64
|
+
"mass": chemical_data["mass"] if chemical_data else None,
|
|
65
|
+
"inchikey": default_structure["standard_inchi_key"]
|
|
66
|
+
if default_structure
|
|
67
|
+
else None,
|
|
76
68
|
}
|
|
77
69
|
|
|
78
70
|
logger.info(f"Write chebi: {chebi_path}")
|
|
@@ -86,7 +78,7 @@ class ChebiQuery:
|
|
|
86
78
|
if __name__ == "__main__":
|
|
87
79
|
chebis = ["CHEBI:2668", "CHEBI:138366", "CHEBI:9637", "CHEBI:155897"]
|
|
88
80
|
for chebi in chebis:
|
|
89
|
-
|
|
81
|
+
console.rule(chebi, align="left", style="bold white")
|
|
90
82
|
d = ChebiQuery.query(chebi=chebi, cache=False)
|
|
91
|
-
|
|
83
|
+
console.print(d)
|
|
92
84
|
d = ChebiQuery.query(chebi=chebi, cache=True)
|
|
@@ -98,6 +98,8 @@ class RDFAnnotation:
|
|
|
98
98
|
f"{resource} does not conform to "
|
|
99
99
|
f"http(s)://identifiers.org/collection/id or http(s)://identifiers.org/id",
|
|
100
100
|
)
|
|
101
|
+
|
|
102
|
+
# handle urns
|
|
101
103
|
elif resource.startswith("urn:miriam:"):
|
|
102
104
|
match3 = MIRIAM_URN_PATTERN.match(resource)
|
|
103
105
|
if match3:
|
|
@@ -113,13 +115,14 @@ class RDFAnnotation:
|
|
|
113
115
|
else:
|
|
114
116
|
# handle short notation
|
|
115
117
|
tokens = resource.split("/")
|
|
116
|
-
if len(tokens)
|
|
118
|
+
if len(tokens) > 1:
|
|
117
119
|
self.collection = tokens[0]
|
|
118
120
|
self.term = "/".join(tokens[1:])
|
|
119
121
|
elif len(tokens) == 1 and ":" in tokens[0]:
|
|
120
122
|
self.collection = tokens[0].split(":")[0].lower()
|
|
121
123
|
self.term = tokens[0]
|
|
122
124
|
|
|
125
|
+
# validation
|
|
123
126
|
if len(tokens) < 2 and not self.collection:
|
|
124
127
|
logger.error(
|
|
125
128
|
f"Resource `{resource}` could not be split in collection and term. "
|