biocypher 0.6.2__py3-none-any.whl → 0.7.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.
Potentially problematic release.
This version of biocypher might be problematic. Click here for more details.
- biocypher/__init__.py +3 -13
- biocypher/_config/__init__.py +6 -23
- biocypher/_core.py +360 -262
- biocypher/_create.py +13 -27
- biocypher/_deduplicate.py +4 -11
- biocypher/_get.py +21 -60
- biocypher/_logger.py +4 -16
- biocypher/_mapping.py +4 -17
- biocypher/_metadata.py +3 -15
- biocypher/_misc.py +14 -28
- biocypher/_ontology.py +127 -212
- biocypher/_translate.py +34 -58
- biocypher/output/connect/_get_connector.py +40 -0
- biocypher/output/connect/_neo4j_driver.py +9 -65
- biocypher/output/in_memory/_get_in_memory_kg.py +34 -0
- biocypher/output/in_memory/_in_memory_kg.py +40 -0
- biocypher/output/in_memory/_networkx.py +44 -0
- biocypher/output/in_memory/_pandas.py +20 -15
- biocypher/output/write/_batch_writer.py +132 -177
- biocypher/output/write/_get_writer.py +11 -24
- biocypher/output/write/_writer.py +14 -33
- biocypher/output/write/graph/_arangodb.py +7 -24
- biocypher/output/write/graph/_neo4j.py +51 -56
- biocypher/output/write/graph/_networkx.py +36 -43
- biocypher/output/write/graph/_rdf.py +107 -95
- biocypher/output/write/relational/_csv.py +6 -11
- biocypher/output/write/relational/_postgresql.py +5 -13
- biocypher/output/write/relational/_sqlite.py +3 -1
- {biocypher-0.6.2.dist-info → biocypher-0.7.0.dist-info}/LICENSE +1 -1
- {biocypher-0.6.2.dist-info → biocypher-0.7.0.dist-info}/METADATA +3 -3
- biocypher-0.7.0.dist-info/RECORD +43 -0
- {biocypher-0.6.2.dist-info → biocypher-0.7.0.dist-info}/WHEEL +1 -1
- biocypher-0.6.2.dist-info/RECORD +0 -39
biocypher/__init__.py
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# Copyright 2021, Heidelberg University Clinic
|
|
5
|
-
#
|
|
6
|
-
# File author(s): Sebastian Lobentanzer
|
|
7
|
-
# ...
|
|
8
|
-
#
|
|
9
|
-
# Distributed under MIT licence, see the file `LICENSE`.
|
|
10
|
-
#
|
|
11
1
|
"""
|
|
12
2
|
BioCypher: a unifying framework for biomedical knowledge graphs.
|
|
13
3
|
"""
|
|
@@ -25,10 +15,10 @@ __all__ = [
|
|
|
25
15
|
"APIRequest",
|
|
26
16
|
]
|
|
27
17
|
|
|
28
|
-
from ._get import APIRequest, FileDownload
|
|
29
|
-
from ._core import BioCypher
|
|
30
18
|
from ._config import config, module_data
|
|
31
|
-
from .
|
|
19
|
+
from ._core import BioCypher
|
|
20
|
+
from ._get import APIRequest, FileDownload
|
|
21
|
+
from ._logger import log, logfile, logger
|
|
32
22
|
from ._metadata import __author__, __version__
|
|
33
23
|
|
|
34
24
|
|
biocypher/_config/__init__.py
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# Copyright 2021, Heidelberg University Clinic
|
|
5
|
-
#
|
|
6
|
-
# File author(s): Sebastian Lobentanzer
|
|
7
|
-
# ...
|
|
8
|
-
#
|
|
9
|
-
# Distributed under MIT licence, see the file `LICENSE`.
|
|
10
|
-
#
|
|
11
1
|
"""
|
|
12
2
|
Module data directory, including:
|
|
13
3
|
|
|
@@ -15,12 +5,13 @@ Module data directory, including:
|
|
|
15
5
|
* The default config files
|
|
16
6
|
"""
|
|
17
7
|
|
|
18
|
-
from typing import Any, Optional
|
|
19
8
|
import os
|
|
20
9
|
import warnings
|
|
21
10
|
|
|
22
|
-
import
|
|
11
|
+
from typing import Any, Optional
|
|
12
|
+
|
|
23
13
|
import appdirs
|
|
14
|
+
import yaml
|
|
24
15
|
|
|
25
16
|
__all__ = ["module_data", "module_data_path", "read_config", "config", "reset"]
|
|
26
17
|
|
|
@@ -88,21 +79,13 @@ def read_config() -> dict:
|
|
|
88
79
|
defaults = module_data("biocypher_config")
|
|
89
80
|
user = _read_yaml(_USER_CONFIG_FILE) or {}
|
|
90
81
|
# TODO account for .yml?
|
|
91
|
-
local = (
|
|
92
|
-
_read_yaml("biocypher_config.yaml")
|
|
93
|
-
or _read_yaml("config/biocypher_config.yaml")
|
|
94
|
-
or {}
|
|
95
|
-
)
|
|
82
|
+
local = _read_yaml("biocypher_config.yaml") or _read_yaml("config/biocypher_config.yaml") or {}
|
|
96
83
|
|
|
97
84
|
for key in defaults:
|
|
98
|
-
value =
|
|
99
|
-
local[key] if key in local else user[key] if key in user else None
|
|
100
|
-
)
|
|
85
|
+
value = local[key] if key in local else user[key] if key in user else None
|
|
101
86
|
|
|
102
87
|
if value is not None:
|
|
103
|
-
if isinstance(
|
|
104
|
-
defaults[key], str
|
|
105
|
-
): # first level config (like title)
|
|
88
|
+
if isinstance(defaults[key], str): # first level config (like title)
|
|
106
89
|
defaults[key] = value
|
|
107
90
|
else:
|
|
108
91
|
defaults[key].update(value)
|