biocypher 0.6.2__py3-none-any.whl → 0.8.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.

Files changed (34) hide show
  1. biocypher/__init__.py +3 -13
  2. biocypher/_config/__init__.py +6 -23
  3. biocypher/_config/biocypher_config.yaml +14 -3
  4. biocypher/_core.py +360 -262
  5. biocypher/_create.py +13 -27
  6. biocypher/_deduplicate.py +4 -11
  7. biocypher/_get.py +21 -60
  8. biocypher/_logger.py +4 -16
  9. biocypher/_mapping.py +4 -17
  10. biocypher/_metadata.py +3 -15
  11. biocypher/_misc.py +14 -28
  12. biocypher/_ontology.py +127 -212
  13. biocypher/_translate.py +34 -58
  14. biocypher/output/connect/_get_connector.py +40 -0
  15. biocypher/output/connect/_neo4j_driver.py +9 -65
  16. biocypher/output/in_memory/_get_in_memory_kg.py +34 -0
  17. biocypher/output/in_memory/_in_memory_kg.py +40 -0
  18. biocypher/output/in_memory/_networkx.py +44 -0
  19. biocypher/output/in_memory/_pandas.py +20 -15
  20. biocypher/output/write/_batch_writer.py +166 -179
  21. biocypher/output/write/_get_writer.py +11 -24
  22. biocypher/output/write/_writer.py +43 -44
  23. biocypher/output/write/graph/_arangodb.py +7 -24
  24. biocypher/output/write/graph/_neo4j.py +51 -56
  25. biocypher/output/write/graph/_networkx.py +36 -43
  26. biocypher/output/write/graph/_rdf.py +107 -95
  27. biocypher/output/write/relational/_csv.py +6 -11
  28. biocypher/output/write/relational/_postgresql.py +5 -13
  29. biocypher/output/write/relational/_sqlite.py +3 -1
  30. {biocypher-0.6.2.dist-info → biocypher-0.8.0.dist-info}/LICENSE +1 -1
  31. {biocypher-0.6.2.dist-info → biocypher-0.8.0.dist-info}/METADATA +3 -3
  32. biocypher-0.8.0.dist-info/RECORD +43 -0
  33. {biocypher-0.6.2.dist-info → biocypher-0.8.0.dist-info}/WHEEL +1 -1
  34. biocypher-0.6.2.dist-info/RECORD +0 -39
@@ -1,5 +1,5 @@
1
- import os
2
1
  import glob
2
+ import os
3
3
 
4
4
  from biocypher._logger import logger
5
5
  from biocypher.output.write._batch_writer import _BatchWriter
@@ -52,9 +52,7 @@ class _PostgreSQLBatchWriter(_BatchWriter):
52
52
  try:
53
53
  return self.DATA_TYPE_LOOKUP[string]
54
54
  except KeyError:
55
- logger.info(
56
- 'Could not determine data type {string}. Using default "VARCHAR"'
57
- )
55
+ logger.info('Could not determine data type {string}. Using default "VARCHAR"')
58
56
  return "VARCHAR"
59
57
 
60
58
  def _quote_string(self, value: str) -> str:
@@ -147,9 +145,7 @@ class _PostgreSQLBatchWriter(_BatchWriter):
147
145
  command += f"DROP TABLE IF EXISTS {pascal_label};\n"
148
146
 
149
147
  # table creation requires comma separation
150
- command += (
151
- f'CREATE TABLE {pascal_label}({",".join(columns)});\n'
152
- )
148
+ command += f"CREATE TABLE {pascal_label}({','.join(columns)});\n"
153
149
  f.write(command)
154
150
 
155
151
  for parts_path in parts_paths:
@@ -246,9 +242,7 @@ class _PostgreSQLBatchWriter(_BatchWriter):
246
242
  command += f"DROP TABLE IF EXISTS {pascal_label};\n"
247
243
 
248
244
  # table creation requires comma separation
249
- command += (
250
- f'CREATE TABLE {pascal_label}({",".join(out_list)});\n'
251
- )
245
+ command += f"CREATE TABLE {pascal_label}({','.join(out_list)});\n"
252
246
  f.write(command)
253
247
 
254
248
  for parts_path in parts_paths:
@@ -299,9 +293,7 @@ class _PostgreSQLBatchWriter(_BatchWriter):
299
293
  if {self.db_password}:
300
294
  # set password variable inline
301
295
  import_call += f"PGPASSWORD={self.db_password} "
302
- import_call += (
303
- f"{self.import_call_bin_prefix}psql -f {import_file_path}"
304
- )
296
+ import_call += f"{self.import_call_bin_prefix}psql -f {import_file_path}"
305
297
  import_call += f" --dbname {self.db_name}"
306
298
  import_call += f" --host {self.db_host}"
307
299
  import_call += f" --port {self.db_port}"
@@ -44,7 +44,9 @@ class _SQLiteBatchWriter(_PostgreSQLBatchWriter):
44
44
  import_call += f'echo "Importing {table_part}..."\n'
45
45
  separator = self.delim
46
46
  import_part = f".import {table_part} {table_name}"
47
- import_call += f"{self.import_call_bin_prefix}sqlite3 -separator $'{separator}' {self.db_name} \"{import_part}\""
47
+ import_call += (
48
+ f"{self.import_call_bin_prefix}sqlite3 -separator $'{separator}' {self.db_name} \"{import_part}\""
49
+ )
48
50
  import_call += '\necho "Done!"\n'
49
51
  import_call += "\n"
50
52
 
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Saez Lab
3
+ Copyright (c) 2022-2025 BioCypher developers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biocypher
3
- Version: 0.6.2
3
+ Version: 0.8.0
4
4
  Summary: A unifying framework for biomedical research knowledge graphs
5
5
  Home-page: https://github.com/biocypher/biocypher
6
6
  License: MIT
7
7
  Author: Sebastian Lobentanzer
8
8
  Author-email: sebastian.lobentanzer@gmail.com
9
- Requires-Python: >=3.9,<4.0
9
+ Requires-Python: >=3.10,<4.0
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: Science/Research
@@ -15,9 +15,9 @@ Classifier: Natural Language :: English
15
15
  Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
22
22
  Requires-Dist: PyYAML (>=5.0)
23
23
  Requires-Dist: appdirs
@@ -0,0 +1,43 @@
1
+ biocypher/__init__.py,sha256=-iq15Q3LhB8WBQjnD15ghszEdaqJ1XvQIF5IaF88KNQ,783
2
+ biocypher/_config/__init__.py,sha256=ku86JZaRrzW5NEz5EXsCRktFwxS0Yo2dwX4UuazdfA4,3416
3
+ biocypher/_config/biocypher_config.yaml,sha256=KdeqgY27YIyvZICNVBCI3h9y7duqF-buynXF_1G5dRY,3368
4
+ biocypher/_config/test_config.yaml,sha256=Np8jeS5_EP6HHOvMKb7B_Tkyqd5YaYlYz_DVsXypt-A,119
5
+ biocypher/_config/test_schema_config.yaml,sha256=D1600WgEj3iTXrumVU9LIivJHJO36iaxfkOgyam9zVU,3129
6
+ biocypher/_config/test_schema_config_disconnected.yaml,sha256=Qm8FLxEn2spHcyj_5F859KjcDvKSxNhxDvi4b4LLkvQ,68
7
+ biocypher/_config/test_schema_config_extended.yaml,sha256=wn3A76142hhjnImhMF6RODbCFESTJ2TtPvcFdIFsAT0,3309
8
+ biocypher/_core.py,sha256=CGbGHX3-JuJsQJsmLFsFNylPiPiJx83aXq05ocPSeUA,26354
9
+ biocypher/_create.py,sha256=QsvXrwEQ8k0uNXvCG06UKejvw-QsJwzSaumrBjx9n1k,9884
10
+ biocypher/_deduplicate.py,sha256=rtglcaLRaVzNjLtaPwTGP8VvCM4PHYQ5CZ-cm32CrKQ,4840
11
+ biocypher/_get.py,sha256=2kjiBFu_onGUhgOpV7IMfGX67jyY1rpHg_GWncEUdrc,13278
12
+ biocypher/_logger.py,sha256=y9dh3SPJOCWXnkFSYSK7aj_-pB7zlAkNCf43Dp1lt74,2941
13
+ biocypher/_mapping.py,sha256=ntspG2C_NaQODhWTBFk0CDvolkOCjtqlQ9E-NkJAuTg,9030
14
+ biocypher/_metadata.py,sha256=xVVYPjLr00BmeV7okCdmxRgsd1clEQkQz4R93HOA8uk,1415
15
+ biocypher/_misc.py,sha256=N8aDg8j3EEcKf9ZRqzSNruUEUK4RixCy1vQ1V4maGxk,6079
16
+ biocypher/_ontology.py,sha256=McN50IAjmlVUUOc-7kpIdskCeatsmVpJ1a90ca6FQ7Y,30638
17
+ biocypher/_translate.py,sha256=sXyXIg6hpR6Y-dp8NtoAN-H4mzrGI4t1ivlBGxaeqWM,16379
18
+ biocypher/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ biocypher/output/connect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ biocypher/output/connect/_get_connector.py,sha256=r-DeDnvGyFEWOd9bXaXQOgVws9rgWz5kwwdzbmt5eKk,1038
21
+ biocypher/output/connect/_neo4j_driver.py,sha256=kXjOXW12wZFfEp7plAuo40bPSvOfd-i9m4YaXoMq-p0,12357
22
+ biocypher/output/in_memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ biocypher/output/in_memory/_get_in_memory_kg.py,sha256=JuNwVx-qABeLikkI9VXQJNQH8xQWvYLEK_KKz3BrXPI,937
24
+ biocypher/output/in_memory/_in_memory_kg.py,sha256=g1TPN8PkeAyXbrRuTAjshqC8voI6EmLqR8S_otmviwU,1423
25
+ biocypher/output/in_memory/_networkx.py,sha256=cSOSAreP7S3oeGT6noZ1kAIvSnkVnU3NUp1OY4yqzn0,1515
26
+ biocypher/output/in_memory/_pandas.py,sha256=Ot2jbK5t_YLHqw0BUv9Z_qWNy9r6IX1LYEyejOSJzos,3288
27
+ biocypher/output/write/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
+ biocypher/output/write/_batch_writer.py,sha256=4w1YTXF1iAvzZyqcJLhirmKkU12J8NJqb4SiNjM91cY,38044
29
+ biocypher/output/write/_get_writer.py,sha256=PCF-JMCGwlh5hLl1SFLseNsBH1Nt49XTKcqximKwfDY,3532
30
+ biocypher/output/write/_writer.py,sha256=y0dWI-RyQdrBLr9Fs91Y9KcCMjnlCaKJT0eWsIS2hG4,7158
31
+ biocypher/output/write/graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ biocypher/output/write/graph/_arangodb.py,sha256=NBnVJa4WuK7WNTIAXOg62YjAMAQfEZtcJX97erNLgSw,7794
33
+ biocypher/output/write/graph/_neo4j.py,sha256=aMq8XKZ_UMbDI1gZmZx0D4T3pY2E4l1jMqX78M3TJK0,12051
34
+ biocypher/output/write/graph/_networkx.py,sha256=2WYkw5ZM3Bp236iwAxEAp3A1DxHKT4_hEPNMUKvPHp4,2320
35
+ biocypher/output/write/graph/_rdf.py,sha256=Vt_mb3HsRrDdrWmwwPsGXshbjjiUd9ZAoLJxoKoglCE,18075
36
+ biocypher/output/write/relational/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ biocypher/output/write/relational/_csv.py,sha256=m0BSQXts88Qu5AEvoIgnwRz54ia38g4VN3PaA3LCYM8,2807
38
+ biocypher/output/write/relational/_postgresql.py,sha256=RckQJBiuwvDmHAyXxS8zCavYqDecHHWW_piofurokfQ,11965
39
+ biocypher/output/write/relational/_sqlite.py,sha256=BuGWOeeNA83lbUvjpkzqcR9_baWLsbfmLXBKe4O1EPE,2105
40
+ biocypher-0.8.0.dist-info/LICENSE,sha256=oejgxuxyjSnyPw3YPloz6-dCBB_nYizJ4jDQnr-xZUU,1082
41
+ biocypher-0.8.0.dist-info/METADATA,sha256=VByGBm1JcK0yiXCq2aNWSAbguf5_5Lv8rCDTyG1uOLs,10643
42
+ biocypher-0.8.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
43
+ biocypher-0.8.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: poetry-core 1.8.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,39 +0,0 @@
1
- biocypher/__init__.py,sha256=-vr7dGUv6QK7f_i9mmUK5WpMsZuFPflUEFC4oElJTCA,980
2
- biocypher/_config/__init__.py,sha256=fFHRFYxE2MtDAQWL6upe--MJ1vw3Z8CwIPhF2gW8cRU,3698
3
- biocypher/_config/biocypher_config.yaml,sha256=pusj0IjJM3uWRcm0N7U7mb1IX257HCV2reZV3YKFCk0,3037
4
- biocypher/_config/test_config.yaml,sha256=Np8jeS5_EP6HHOvMKb7B_Tkyqd5YaYlYz_DVsXypt-A,119
5
- biocypher/_config/test_schema_config.yaml,sha256=D1600WgEj3iTXrumVU9LIivJHJO36iaxfkOgyam9zVU,3129
6
- biocypher/_config/test_schema_config_disconnected.yaml,sha256=Qm8FLxEn2spHcyj_5F859KjcDvKSxNhxDvi4b4LLkvQ,68
7
- biocypher/_config/test_schema_config_extended.yaml,sha256=wn3A76142hhjnImhMF6RODbCFESTJ2TtPvcFdIFsAT0,3309
8
- biocypher/_core.py,sha256=m4o4Szv2xY2gl3PnNAA9m7Gg5Sgd8iR9THv3RDyZlQ8,22618
9
- biocypher/_create.py,sha256=vpUchUdEpWupZi1LgFLxAWMtqoBwnWbP7PwEDUCBS4A,10202
10
- biocypher/_deduplicate.py,sha256=BBvfpXzu6L5YDY5FdtXxnf8YlsbJpbCE8RdUoKsm0n0,4949
11
- biocypher/_get.py,sha256=1FHs4n2R2k7OVWtVe7euF2J5WpsUXsFAmnpdSYuhLvY,13817
12
- biocypher/_logger.py,sha256=NGXe3hZA79WSujfOgpcxHBf8N2QAfrmvM1LFDpsGK2U,3185
13
- biocypher/_mapping.py,sha256=ERSNH2Bg19145KytxbFE4BInPaiP-LWW7osOBot29Eo,9304
14
- biocypher/_metadata.py,sha256=D4HcHz3EKz_aLJ709LEcSnv5K3Nj4kX6DShGeA7j2Po,1657
15
- biocypher/_misc.py,sha256=oKNfmj9mUKDYtmx-R6FCZxRa7AOut3VKZZm16KFimyY,6363
16
- biocypher/_ontology.py,sha256=G5k-bnzvPZUqhLPxtoOPFa4OSQ4JpufgozVakLTjwLg,31789
17
- biocypher/_translate.py,sha256=JafvhtVaFSpruRfYh9BzjVbvDF1Mhg7LLKMDZHWkRjg,16496
18
- biocypher/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- biocypher/output/connect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- biocypher/output/connect/_neo4j_driver.py,sha256=jzF5sDhs_WnYEfXiSjQ1P3wNgoadl4Cg80EUYYOk0Ro,13497
21
- biocypher/output/in_memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- biocypher/output/in_memory/_pandas.py,sha256=lsYQKjfxUy0O-ae4-YpsCJX-l85bxyc60WOj8gKfMfU,3080
23
- biocypher/output/write/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- biocypher/output/write/_batch_writer.py,sha256=Yev0Qpm6Tx2Z9Y89xAWPSy8rLuD1g3FbVKcG9R2D1yA,37239
25
- biocypher/output/write/_get_writer.py,sha256=AeQcHQTrz68ZvtxsZl4W0ymc8cOxe3Qfq5PJRY7kq_I,3736
26
- biocypher/output/write/_writer.py,sha256=v4-c8yME1UCJeqy8Lfmv7KtY7_B4QkWgADt5xkFNJFQ,7453
27
- biocypher/output/write/graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- biocypher/output/write/graph/_arangodb.py,sha256=aUa_CNZyunFaPrJHc9RtVHRo0Fca9xJ-ZmRz4PxPO8c,8078
29
- biocypher/output/write/graph/_neo4j.py,sha256=rWCyxeajN3TCbE6W4L57c-CBrqtShVa8ufUkCjVZlGc,12067
30
- biocypher/output/write/graph/_networkx.py,sha256=EW2we3FlqQ8KfLv4l_2wE27KBUlhXJyD5ORvowSjlaA,2545
31
- biocypher/output/write/graph/_rdf.py,sha256=DdpStVXNEIdEvVHo23Qru63XY_IsUbfeAKjs9TPjHbo,18125
32
- biocypher/output/write/relational/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- biocypher/output/write/relational/_csv.py,sha256=eyAtmwfCNYnuVbkpd0rUoo9KgG2KPgopZVA3X97tRLU,2919
34
- biocypher/output/write/relational/_postgresql.py,sha256=MRgDicNRW0KWene1nag4FgJ-nEUlpkulatG1S8D33s0,12107
35
- biocypher/output/write/relational/_sqlite.py,sha256=ozElhca1YCYq8R-VFh-LDsnPBaXVJm2cvEboBK2LVVY,2073
36
- biocypher-0.6.2.dist-info/LICENSE,sha256=SjUaQkq671iQUZOxEUpC4jvJxXOlfSiHTTueyz9kXJM,1065
37
- biocypher-0.6.2.dist-info/METADATA,sha256=ZJfAl8_BsK1mRwFFy0HJOlkLKGiAByTeEdlwHX3C8Ec,10641
38
- biocypher-0.6.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
39
- biocypher-0.6.2.dist-info/RECORD,,