terminusdb 12.0.0__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.
Files changed (111) hide show
  1. terminusdb-12.0.0/LICENSE +201 -0
  2. terminusdb-12.0.0/PKG-INFO +293 -0
  3. terminusdb-12.0.0/README.md +268 -0
  4. terminusdb-12.0.0/pyproject.toml +71 -0
  5. terminusdb-12.0.0/terminusdb/__init__.py +4 -0
  6. terminusdb-12.0.0/terminusdb/client/__init__.py +2 -0
  7. terminusdb-12.0.0/terminusdb/query_syntax/__init__.py +1 -0
  8. terminusdb-12.0.0/terminusdb/schema/__init__.py +1 -0
  9. terminusdb-12.0.0/terminusdb_client/__init__.py +8 -0
  10. terminusdb-12.0.0/terminusdb_client/__version__.py +9 -0
  11. terminusdb-12.0.0/terminusdb_client/client/Client.py +3409 -0
  12. terminusdb-12.0.0/terminusdb_client/client/__init__.py +1 -0
  13. terminusdb-12.0.0/terminusdb_client/errors.py +124 -0
  14. terminusdb-12.0.0/terminusdb_client/query_syntax/__init__.py +1 -0
  15. terminusdb-12.0.0/terminusdb_client/query_syntax/query_syntax.py +31 -0
  16. terminusdb-12.0.0/terminusdb_client/schema/__init__.py +1 -0
  17. terminusdb-12.0.0/terminusdb_client/schema/schema.py +1008 -0
  18. terminusdb-12.0.0/terminusdb_client/scripts/__init__.py +1 -0
  19. terminusdb-12.0.0/terminusdb_client/scripts/__main__.py +4 -0
  20. terminusdb-12.0.0/terminusdb_client/scripts/dev.py +401 -0
  21. terminusdb-12.0.0/terminusdb_client/scripts/schema_template.py +97 -0
  22. terminusdb-12.0.0/terminusdb_client/scripts/scripts.py +926 -0
  23. terminusdb-12.0.0/terminusdb_client/tests/AllServerRecords.py +397 -0
  24. terminusdb-12.0.0/terminusdb_client/tests/DBRecord.py +36 -0
  25. terminusdb-12.0.0/terminusdb_client/tests/__init__.py +0 -0
  26. terminusdb-12.0.0/terminusdb_client/tests/ans_cardinality.py +479 -0
  27. terminusdb-12.0.0/terminusdb_client/tests/ans_doctype.py +133 -0
  28. terminusdb-12.0.0/terminusdb_client/tests/ans_insert.py +47 -0
  29. terminusdb-12.0.0/terminusdb_client/tests/ans_property.py +209 -0
  30. terminusdb-12.0.0/terminusdb_client/tests/ans_triple_quad.py +34 -0
  31. terminusdb-12.0.0/terminusdb_client/tests/conftest.py +114 -0
  32. terminusdb-12.0.0/terminusdb_client/tests/connectCapabilitiesResponse.py +32 -0
  33. terminusdb-12.0.0/terminusdb_client/tests/connectionDictionary.json +145 -0
  34. terminusdb-12.0.0/terminusdb_client/tests/connectionObjDump.py +494 -0
  35. terminusdb-12.0.0/terminusdb_client/tests/getAllClassDocument.json +107 -0
  36. terminusdb-12.0.0/terminusdb_client/tests/getAllClassQueryResponse.json +65 -0
  37. terminusdb-12.0.0/terminusdb_client/tests/getSchemaTurtleResponse.py +1 -0
  38. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/__init__.py +0 -0
  39. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/conftest.py +418 -0
  40. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/mock_jsons.py +97 -0
  41. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test-docker-compose-jwt.yml +16 -0
  42. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test-docker-compose.yml +48 -0
  43. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_client.py +675 -0
  44. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_conftest.py +99 -0
  45. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_csv.csv +17 -0
  46. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_prefix_management.py +142 -0
  47. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_schema.py +341 -0
  48. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_scripts.py +236 -0
  49. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_woql_collect.py +142 -0
  50. terminusdb-12.0.0/terminusdb_client/tests/integration_tests/test_woql_set_operations.py +184 -0
  51. terminusdb-12.0.0/terminusdb_client/tests/mockResponse.py +177 -0
  52. terminusdb-12.0.0/terminusdb_client/tests/selectAllClassQuery.json +105 -0
  53. terminusdb-12.0.0/terminusdb_client/tests/serverRecordsFromCap.py +46 -0
  54. terminusdb-12.0.0/terminusdb_client/tests/showAllDocumentClassesResponse.json +20 -0
  55. terminusdb-12.0.0/terminusdb_client/tests/test_Client.py +727 -0
  56. terminusdb-12.0.0/terminusdb_client/tests/test_Schema.py +463 -0
  57. terminusdb-12.0.0/terminusdb_client/tests/test_backwardsCompat.py +22 -0
  58. terminusdb-12.0.0/terminusdb_client/tests/test_client_init.py +49 -0
  59. terminusdb-12.0.0/terminusdb_client/tests/test_errors.py +224 -0
  60. terminusdb-12.0.0/terminusdb_client/tests/test_graphtype.py +27 -0
  61. terminusdb-12.0.0/terminusdb_client/tests/test_main.py +0 -0
  62. terminusdb-12.0.0/terminusdb_client/tests/test_query_syntax.py +80 -0
  63. terminusdb-12.0.0/terminusdb_client/tests/test_schema_template.py +166 -0
  64. terminusdb-12.0.0/terminusdb_client/tests/test_scripts.py +72 -0
  65. terminusdb-12.0.0/terminusdb_client/tests/test_scripts_main.py +31 -0
  66. terminusdb-12.0.0/terminusdb_client/tests/test_slice.py +75 -0
  67. terminusdb-12.0.0/terminusdb_client/tests/test_woqlCore.py +19 -0
  68. terminusdb-12.0.0/terminusdb_client/tests/test_woqlExtra.py +43 -0
  69. terminusdb-12.0.0/terminusdb_client/tests/test_woqlQuery.py +765 -0
  70. terminusdb-12.0.0/terminusdb_client/tests/test_woql_idgen_random.py +129 -0
  71. terminusdb-12.0.0/terminusdb_client/tests/test_woql_localize.py +246 -0
  72. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_advanced.py +414 -0
  73. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_basics.py +256 -0
  74. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_builders.py +426 -0
  75. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_cleaners.py +660 -0
  76. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_methods.py +405 -0
  77. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_triples_quads.py +419 -0
  78. terminusdb-12.0.0/terminusdb_client/tests/test_woql_query_utils.py +331 -0
  79. terminusdb-12.0.0/terminusdb_client/tests/test_woql_rdflist.py +440 -0
  80. terminusdb-12.0.0/terminusdb_client/tests/test_woql_utils.py +258 -0
  81. terminusdb-12.0.0/terminusdb_client/tests/test_woqldataframe.py +201 -0
  82. terminusdb-12.0.0/terminusdb_client/tests/woql_test_helpers.py +182 -0
  83. terminusdb-12.0.0/terminusdb_client/tests/woqljson/__init__.py +0 -0
  84. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlAndJson.py +23 -0
  85. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlCastJson.py +6 -0
  86. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlConcatJson.py +15 -0
  87. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlDeleteJson.py +22 -0
  88. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlDoctypeJson.py +22 -0
  89. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlExtraJson.py +57 -0
  90. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlIdgenJson.py +40 -0
  91. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlJoinSplitJson.py +35 -0
  92. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlJson.py +264 -0
  93. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlLimitStar.py +19 -0
  94. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlMathJson.py +93 -0
  95. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlOptJson.py +12 -0
  96. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlOrJson.py +23 -0
  97. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlReJson.py +15 -0
  98. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlSelectJson.py +28 -0
  99. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlSliceJson.py +77 -0
  100. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlStarJson.py +19 -0
  101. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlTrimJson.py +11 -0
  102. terminusdb-12.0.0/terminusdb_client/tests/woqljson/woqlWhenJson.py +11 -0
  103. terminusdb-12.0.0/terminusdb_client/woql_type.py +203 -0
  104. terminusdb-12.0.0/terminusdb_client/woql_utils.py +121 -0
  105. terminusdb-12.0.0/terminusdb_client/woqlclient/__init__.py +5 -0
  106. terminusdb-12.0.0/terminusdb_client/woqldataframe/__init__.py +1 -0
  107. terminusdb-12.0.0/terminusdb_client/woqldataframe/woqlDataframe.py +90 -0
  108. terminusdb-12.0.0/terminusdb_client/woqlquery/__init__.py +19 -0
  109. terminusdb-12.0.0/terminusdb_client/woqlquery/woql_core.py +163 -0
  110. terminusdb-12.0.0/terminusdb_client/woqlquery/woql_query.py +4382 -0
  111. terminusdb-12.0.0/terminusdb_client/woqlschema/__init__.py +5 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,293 @@
1
+ Metadata-Version: 2.4
2
+ Name: terminusdb
3
+ Version: 12.0.0
4
+ Summary: Terminus DB Python client
5
+ License: Apache Software License
6
+ License-File: LICENSE
7
+ Author: TerminusDB group
8
+ Requires-Python: >=3.9.0,<3.13
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Dist: click (>=8.0)
16
+ Requires-Dist: numpy (>=1.13.0)
17
+ Requires-Dist: numpydoc
18
+ Requires-Dist: pandas (>=0.23.0)
19
+ Requires-Dist: requests (>=2.31.0,<3.0.0)
20
+ Requires-Dist: shed
21
+ Requires-Dist: tqdm
22
+ Requires-Dist: typeguard (>=2.13.3,<2.14.0)
23
+ Description-Content-Type: text/markdown
24
+
25
+ [![TerminusDB Python Client](https://assets.terminusdb.com/readmes/terminusdb-client-python/header.gif)][terminusdb-client-python-docs]
26
+
27
+ [terminusdb-client-python-docs]: https://terminusdb.com/docs/python
28
+
29
+ ---
30
+
31
+ [![Discord](https://img.shields.io/discord/689805612053168129?label=Discord&logo=Discord&style=plastic)](https://discord.gg/yTJKAma)
32
+ [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/TerminusDB?style=social)](https://www.reddit.com/r/TerminusDB/)
33
+ [![Twitter](https://img.shields.io/twitter/follow/terminusdb?color=skyblue&label=Follow%20on%20Twitter&logo=twitter&style=flat)](https://twitter.com/TerminusDB)
34
+
35
+ [![release version](https://img.shields.io/pypi/v/terminusdb.svg?logo=pypi)](https://pypi.python.org/pypi/terminusdb/)
36
+ [![downloads](https://img.shields.io/pypi/dm/terminusdb.svg?logo=pypi)](https://pypi.python.org/pypi/terminusdb/)
37
+
38
+ [![build status](https://img.shields.io/github/workflow/status/terminusdb/terminusdb-client-python/Python%20package?logo=github)](https://github.com/terminusdb/terminusdb-client-python/actions)
39
+ [![documentation](https://img.shields.io/github/deployments/terminusdb/terminusdb-client-python/github-pages?label=documentation&logo=github)](https://terminusdb.org/docs/python)
40
+ [![code coverage](https://codecov.io/gh/terminusdb/terminusdb-client-python/branch/main/graph/badge.svg?token=BclAUaOPnQ)](https://codecov.io/gh/terminusdb/terminusdb-client-python)
41
+ [![license](https://img.shields.io/github/license/terminusdb/terminusdb-client-python?color=pink&logo=apache)](https://github.com/terminusdb/terminusdb-client-python/blob/main/LICENSE)
42
+
43
+ > Python client for TerminusDB and TerminusCMS.
44
+
45
+ > **Migrating from `terminusdb-client`?** This package was formerly known as
46
+ > `terminusdb-client`. Simply install `terminusdb` instead — both `import terminusdb`
47
+ > and `import terminusdb_client` continue to work, so no code changes are required.
48
+
49
+ [**TerminusDB**][terminusdb] is an [open-source][terminusdb-repo] graph database
50
+ and document store. It allows you to link JSON documents in a powerful knowledge
51
+ graph all through a simple document API, with full git-for-data version control.
52
+
53
+ [terminusdb]: https://terminusdb.org/
54
+ [terminusdb-docs]: https://terminusdb.org/docs/
55
+ [terminusdb-repo]: https://github.com/terminusdb/terminusdb
56
+
57
+ ## Requirements
58
+
59
+ - [TerminusDB v12.1](https://github.com/terminusdb/terminusdb-server)
60
+ - [Python >=3.9](https://www.python.org/downloads)
61
+
62
+ ## Release Notes and Previous Versions
63
+
64
+ TerminusDB Client v12 works with TerminusDB v12 onwards and the [DFRNT cloud service](https://dfrnt.com). Please check the [Release Notes](RELEASE_NOTES.md) to find out what has changed.
65
+
66
+ ## Installation
67
+ - TerminusDB Client can be downloaded from PyPI using pip:
68
+ `python -m pip install terminusdb`
69
+
70
+ This only includes the core Python Client (Client) and WOQLQuery.
71
+
72
+ If you want to use woqlDataframe or the import and export CSV function in the Scaffolding CLI tool:
73
+
74
+ `python -m pip install terminusdb[dataframe]`
75
+
76
+ *if you are installing from `zsh` you have to quote the argument like this:*
77
+
78
+ `python -m pip install 'terminusdb[dataframe]'`
79
+
80
+ - Install from source:
81
+
82
+ `python -m pip install git+https://github.com/terminusdb/terminusdb-client-python.git`
83
+
84
+ ## Demo
85
+
86
+ ![Client Demo gif](https://github.com/terminusdb/terminusdb-web-assets/blob/master/images/terminusdb%20python%20v10%20client%20demo%201.gif)
87
+
88
+ ## Usage
89
+
90
+ ### Python client
91
+
92
+ #### Connect to a server
93
+
94
+ Connect to local host
95
+
96
+ ```Python
97
+ from terminusdb import Client
98
+
99
+ client = Client("http://127.0.0.1:6363/")
100
+ client.connect()
101
+ ```
102
+
103
+ The previous import path `from terminusdb_client import Client` also continues to work.
104
+
105
+ Connect to TerminusDB in the cloud
106
+
107
+ *check the documentation on the DFRNT support page about how to add your [API token](https://support.dfrnt.com/portal/en/kb/articles/api) to the environment variable*
108
+
109
+
110
+ ```Python
111
+ from terminusdb import Client
112
+
113
+ team="MyTeam"
114
+ client = Client(f"https://studio.dfrnt.com/api/hosted/{team}/")
115
+ client.connect(team="MyTeam", use_token=True)
116
+ ```
117
+
118
+ #### Create a database
119
+
120
+ ```Python
121
+ client.create_database("MyDatabase")
122
+ ```
123
+
124
+ #### Create a schema
125
+
126
+ ```Python
127
+ from terminusdb.schema import Schema, DocumentTemplate, RandomKey
128
+
129
+ my_schema = Schema()
130
+
131
+ class Pet(DocumentTemplate):
132
+ _schema = my_schema
133
+ name: str
134
+ species: str
135
+ age: int
136
+ weight: float
137
+
138
+ my_schema.commit(client)
139
+ ```
140
+
141
+ #### Create and insert documents
142
+
143
+ ```Python
144
+ my_dog = Pet(name="Honda", species="Huskey", age=3, weight=21.1)
145
+ my_cat = Pet(name="Tiger", species="Bengal cat", age=5, weight=4.5)
146
+ client.insert_document([my_dog, my_cat])
147
+ ```
148
+
149
+ #### Get back all documents
150
+
151
+ ```Python
152
+ print(list(client.get_all_documents()))
153
+ ```
154
+
155
+ ```
156
+ [{'@id': 'Pet/b5edacf854e34fe79c228a91e2af45fb', '@type': 'Pet', 'age': 5, 'name': 'Tiger', 'species': 'Bengal cat', 'weight': 4.5}, {'@id': 'Pet/cdbe3f6d49394b38b952ae315309256d', '@type': 'Pet', 'age': 3, 'name': 'Honda', 'species': 'Huskey', 'weight': 21.1}]
157
+ ```
158
+
159
+ #### Get a specific document
160
+
161
+ ```Python
162
+ print(list(client.query_document({"@type":"Pet", "age":5})))
163
+ ```
164
+
165
+ ```
166
+ [{'@id': 'Pet/145eb73966d14a1394f7cd5576d7d0b8', '@type': 'Pet', 'age': 5, 'name': 'Tiger', 'species': 'Bengal cat', 'weight': 4.5}]
167
+ ```
168
+
169
+ #### Delete a database
170
+
171
+ ```Python
172
+ client.delete_database("MyDatabase")
173
+ ```
174
+
175
+ ### Scaffolding CLI tool
176
+
177
+ ![Scaffolding Demo gif](https://github.com/terminusdb/terminusdb-web-assets/blob/master/images/terminusdb%20python%20v10%20scaffolding%20demo%202.gif)
178
+
179
+ Start a project in the directory
180
+
181
+ ```bash
182
+ $ tdbpy startproject
183
+ Please enter a project name (this will also be the database name): mydb
184
+ Please enter an endpoint location (press enter to use localhost default) [http://127.0.0.1:6363/]:
185
+ config.json and schema.py created, please customize them to start your project.
186
+ ```
187
+
188
+ Import a CSV named `grades.csv`
189
+
190
+ ``` bash
191
+ $ tdbpy importcsv grades.csv --na=error
192
+ 0it [00:00, ?it/s]
193
+ Schema object Grades created with grades.csv inserted into database.
194
+ schema.py is updated with mydb schema.
195
+ 1it [00:00, 1.00it/s]
196
+ Records in grades.csv inserted as type Grades into database with Lexical ids.
197
+ ```
198
+
199
+ Get documents with query
200
+
201
+ ```bash
202
+ $ tdbpy alldocs --type Grades -q grade="B-"
203
+ [{'@id': 'Grades/Android_Electric_087-65-4321_42.0_23.0_36.0_45.0_47.0_B-', '@type': 'Grades', 'final': 47.0, 'first_name': 'Electric', 'grade': 'B-', 'last_name': 'Android', 'ssn': '087-65-4321', 'test1': 42.0, 'test2': 23.0, 'test3': 36.0, 'test4': 45.0}, {'@id': 'Grades/Elephant_Ima_456-71-9012_45.0_1.0_78.0_88.0_77.0_B-', '@type': 'Grades', 'final': 77.0, 'first_name': 'Ima', 'grade': 'B-', 'last_name': 'Elephant', 'ssn': '456-71-9012', 'test1': 45.0, 'test2': 1.0, 'test3': 78.0, 'test4': 88.0}, {'@id': 'Grades/Franklin_Benny_234-56-2890_50.0_1.0_90.0_80.0_90.0_B-', '@type': 'Grades', 'final': 90.0, 'first_name': 'Benny', 'grade': 'B-', 'last_name': 'Franklin', 'ssn': '234-56-2890', 'test1': 50.0, 'test2': 1.0, 'test3': 90.0, 'test4': 80.0}]
204
+ ```
205
+
206
+ Delete the database
207
+
208
+ ```bash
209
+ $ tdbpy deletedb
210
+ Do you want to delete 'mydb'? WARNING: This operation is non-reversible. [y/N]: y
211
+ mydb deleted.
212
+ ```
213
+
214
+ ### Please check the [full Documentation](https://terminusdb.org/docs/python) for more information.
215
+
216
+ ## Guides & Tutorials
217
+
218
+ Visit our documentation for a range of short how-to guides, [how-to use the Python Client](https://terminusdb.org/docs/use-the-python-client) and [how to use the collaboration features with the Python Client](https://terminusdb.org/docs/collaboration-with-python-client). Alternatively, undertake the [Getting Started with the Python Client Tutorial Series.](https://github.com/terminusdb/terminusdb-tutorials/blob/main/getting_started/python-client/README.md).
219
+
220
+ ## Testing
221
+
222
+ 1. Clone this repository
223
+ `git clone https://github.com/terminusdb/terminusdb-client-python.git`
224
+
225
+ 2. Install all development dependencies using poetry
226
+ ```sh
227
+ $ make init
228
+ ```
229
+
230
+ 3. (a) To run test files only
231
+ ```sh
232
+ $ poetry run pytest terminusdb_client/tests
233
+ ```
234
+
235
+ 3. (b) To run full test
236
+ ```sh
237
+ $ poetry run tox -e test
238
+ ```
239
+
240
+ Or you can run tests in [poetry shell](https://python-poetry.org/docs/basic-usage/#activating-the-virtual-environment) then no need to use `poetry run`
241
+
242
+ ## Documentation
243
+
244
+ Visit our [TerminusDB Documentation][terminusdb-docs] for the full explanation of using TerminusDB.
245
+
246
+ Documentation specifically on the latest version of the Python Client can be found [here][terminusdb-client-python-docs].
247
+
248
+ ### Generating Documentation Locally using Sphinx
249
+
250
+ 1. Clone this repository
251
+ `git clone https://github.com/terminusdb/terminusdb-client-python.git`
252
+
253
+ 2. Install all development dependencies
254
+ ```sh
255
+ $ make init
256
+ ```
257
+
258
+ 3. Change the directory to docs
259
+ ```sh
260
+ $ cd docs/
261
+ ```
262
+
263
+ 4. Build with Sphinx
264
+ ```sh
265
+ $ make html
266
+ ```
267
+
268
+ The output files are under `docs/build/html`, open `index.html` in your browser to inspect.
269
+
270
+ ## Report Issues
271
+
272
+ If you encounter any issues, please [report them](https://github.com/terminusdb/terminusdb-client-python/issues) with your os and environment setup, the version that you are using and a simple reproducible case.
273
+
274
+ If you have other questions, you can ask in our community [community Subreddit](https://www.reddit.com/r/TerminusDB/) or [Discord server](https://discord.gg/Gvdqw97).
275
+
276
+ ## Community
277
+
278
+ Come visit us on our [discord server](https://discord.gg/yTJKAma)
279
+ or our [community Subreddit](https://www.reddit.com/r/TerminusDB/). We are also on [Twitter](https://twitter.com/TerminusDB)
280
+ <img align="right" src="https://assets.terminusdb.com/images/TerminusDB%20color%20mascot.png" width="256px"/>
281
+
282
+ ## Contribute
283
+
284
+ It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add some test(s) of what value you adding.
285
+
286
+ Please check [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
287
+
288
+ ## Licence
289
+
290
+ Apache License (Version 2.0)
291
+
292
+ Copyright (c) 2019
293
+