biocypher 0.9.2__py3-none-any.whl → 0.12.3__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.
- biocypher/__init__.py +8 -0
- biocypher/_core.py +10 -4
- biocypher/_get.py +129 -46
- biocypher/_graph.py +819 -0
- biocypher/_metadata.py +32 -12
- biocypher/_translate.py +5 -8
- biocypher/_workflow.py +798 -0
- biocypher/output/connect/_get_connector.py +24 -7
- biocypher/output/connect/_neo4j_driver.py +55 -9
- biocypher/output/connect/_neo4j_driver_wrapper.py +1317 -0
- biocypher/output/in_memory/_airr.py +499 -0
- biocypher/output/in_memory/_get_in_memory_kg.py +25 -13
- biocypher/output/in_memory/_in_memory_kg.py +57 -0
- biocypher/output/in_memory/_pandas.py +1 -59
- biocypher/output/templates/powershell_template.ps1 +60 -0
- biocypher/output/write/_batch_writer.py +4 -4
- biocypher/output/write/_get_writer.py +5 -0
- biocypher/output/write/graph/_airr.py +32 -0
- biocypher/output/write/graph/_neo4j.py +91 -5
- biocypher/output/write/relational/_postgresql.py +37 -27
- {biocypher-0.9.2.dist-info → biocypher-0.12.3.dist-info}/METADATA +32 -28
- {biocypher-0.9.2.dist-info → biocypher-0.12.3.dist-info}/RECORD +31 -24
- {biocypher-0.9.2.dist-info → biocypher-0.12.3.dist-info}/WHEEL +1 -1
- biocypher-0.12.3.dist-info/licenses/LICENSE +202 -0
- biocypher-0.12.3.dist-info/licenses/NOTICE +9 -0
- biocypher-0.9.2.dist-info/LICENSE +0 -21
biocypher/_metadata.py
CHANGED
|
@@ -8,9 +8,12 @@ import importlib.metadata
|
|
|
8
8
|
import os
|
|
9
9
|
import pathlib
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
try:
|
|
12
|
+
import toml
|
|
13
|
+
except ImportError:
|
|
14
|
+
toml = None
|
|
12
15
|
|
|
13
|
-
_VERSION = "0.
|
|
16
|
+
_VERSION = "0.12.3"
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
def get_metadata():
|
|
@@ -28,16 +31,33 @@ def get_metadata():
|
|
|
28
31
|
for project_dir in (here, here.parent):
|
|
29
32
|
toml_path = str(project_dir.joinpath(pyproj_toml).absolute())
|
|
30
33
|
|
|
31
|
-
if os.path.exists(toml_path):
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
if os.path.exists(toml_path) and toml is not None:
|
|
35
|
+
try:
|
|
36
|
+
pyproject = toml.load(toml_path)
|
|
37
|
+
except Exception:
|
|
38
|
+
# If toml parsing fails, skip and use fallback
|
|
39
|
+
continue
|
|
40
|
+
|
|
41
|
+
# Use modern PEP 621 format (uv/hatchling)
|
|
42
|
+
if "project" in pyproject:
|
|
43
|
+
project = pyproject["project"]
|
|
44
|
+
meta = {
|
|
45
|
+
"name": project.get("name"),
|
|
46
|
+
"version": project.get("version"),
|
|
47
|
+
"author": project.get("authors", []),
|
|
48
|
+
"license": project.get("license", {}).get("text"),
|
|
49
|
+
"full_metadata": pyproject,
|
|
50
|
+
}
|
|
51
|
+
elif "tool" in pyproject and "poetry" in pyproject["tool"]:
|
|
52
|
+
# Legacy Poetry format fallback (for backward compatibility)
|
|
53
|
+
poetry = pyproject["tool"]["poetry"]
|
|
54
|
+
meta = {
|
|
55
|
+
"name": poetry.get("name"),
|
|
56
|
+
"version": poetry.get("version"),
|
|
57
|
+
"author": poetry.get("authors", []),
|
|
58
|
+
"license": poetry.get("license"),
|
|
59
|
+
"full_metadata": pyproject,
|
|
60
|
+
}
|
|
41
61
|
|
|
42
62
|
break
|
|
43
63
|
|
biocypher/_translate.py
CHANGED
|
@@ -37,15 +37,12 @@ class Translator:
|
|
|
37
37
|
|
|
38
38
|
Args:
|
|
39
39
|
----
|
|
40
|
-
|
|
41
|
-
Dictionary detailing the leaves of the hierarchy
|
|
42
|
-
tree representing the structure of the graph; the leaves are
|
|
43
|
-
the entities that will be direct components of the graph,
|
|
44
|
-
while the intermediary nodes are additional labels for
|
|
45
|
-
filtering purposes.
|
|
40
|
+
ontology (Ontology): An Ontology object providing schema and mapping details.
|
|
46
41
|
strict_mode:
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
strict_mode (bool, optional): If True, enforces that every node and edge carries
|
|
43
|
+
the required 'source', 'licence', and 'version' properties. Raises ValueError
|
|
44
|
+
if these are missing. Defaults to False.
|
|
45
|
+
|
|
49
46
|
|
|
50
47
|
"""
|
|
51
48
|
self.ontology = ontology
|