dkg 8.0.0a3__py3-none-any.whl → 8.0.2__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.
Files changed (72) hide show
  1. dkg/__init__.py +1 -1
  2. dkg/assertion.py +2 -2
  3. dkg/clients/__init__.py +4 -0
  4. dkg/clients/async_dkg.py +109 -0
  5. dkg/{main.py → clients/dkg.py} +42 -21
  6. dkg/constants.py +117 -6
  7. dkg/data/interfaces/AskStorage.json +366 -0
  8. dkg/data/interfaces/Chronos.json +202 -0
  9. dkg/data/interfaces/Hub.json +294 -2
  10. dkg/data/interfaces/IdentityStorage.json +58 -0
  11. dkg/data/interfaces/{ContentAsset.json → KnowledgeCollection.json} +256 -343
  12. dkg/data/interfaces/KnowledgeCollectionStorage.json +2312 -0
  13. dkg/data/interfaces/Paranet.json +30 -214
  14. dkg/data/interfaces/ParanetIncentivesPoolFactory.json +18 -2
  15. dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json +20 -4
  16. dkg/data/interfaces/{ParanetNeurowebIncentivesPool.json → ParanetNeuroIncentivesPool.json} +7 -7
  17. dkg/data/interfaces/ParanetsRegistry.json +102 -32
  18. dkg/data/interfaces/Token.json +146 -17
  19. dkg/managers/__init__.py +0 -0
  20. dkg/managers/async_manager.py +69 -0
  21. dkg/{manager.py → managers/manager.py} +5 -3
  22. dkg/method.py +5 -2
  23. dkg/modules/__init__.py +0 -0
  24. dkg/modules/asset/__init__.py +0 -0
  25. dkg/modules/asset/asset.py +739 -0
  26. dkg/modules/asset/async_asset.py +753 -0
  27. dkg/modules/async_module.py +66 -0
  28. dkg/modules/graph/__init__.py +0 -0
  29. dkg/modules/graph/async_graph.py +112 -0
  30. dkg/modules/graph/graph.py +87 -0
  31. dkg/{module.py → modules/module.py} +1 -1
  32. dkg/modules/network/__init__.py +0 -0
  33. dkg/{network.py → modules/network/network.py} +4 -4
  34. dkg/modules/node/__init__.py +0 -0
  35. dkg/modules/node/async_node.py +39 -0
  36. dkg/{node.py → modules/node/node.py} +2 -2
  37. dkg/modules/paranet/__init__.py +0 -0
  38. dkg/{paranet.py → modules/paranet/paranet.py} +2 -6
  39. dkg/providers/__init__.py +9 -2
  40. dkg/providers/blockchain/__init__.py +4 -0
  41. dkg/providers/blockchain/async_blockchain.py +245 -0
  42. dkg/providers/blockchain/base_blockchain.py +102 -0
  43. dkg/providers/{blockchain.py → blockchain/blockchain.py} +15 -96
  44. dkg/providers/node/__init__.py +4 -0
  45. dkg/providers/node/async_node_http.py +72 -0
  46. dkg/providers/node/base_node_http.py +25 -0
  47. dkg/providers/{node_http.py → node/node_http.py} +12 -10
  48. dkg/services/__init__.py +0 -0
  49. dkg/services/blockchain_services/__init__.py +0 -0
  50. dkg/services/blockchain_services/async_blockchain_service.py +180 -0
  51. dkg/services/blockchain_services/blockchain_service.py +174 -0
  52. dkg/services/input_service.py +181 -0
  53. dkg/services/node_services/__init__.py +0 -0
  54. dkg/services/node_services/async_node_service.py +184 -0
  55. dkg/services/node_services/node_service.py +167 -0
  56. dkg/types/__init__.py +11 -11
  57. dkg/utils/blockchain_request.py +76 -50
  58. dkg/utils/knowledge_asset_tools.py +5 -0
  59. dkg/utils/knowledge_collection_tools.py +248 -0
  60. dkg/utils/node_request.py +60 -14
  61. dkg/utils/rdf.py +9 -3
  62. {dkg-8.0.0a3.dist-info → dkg-8.0.2.dist-info}/METADATA +28 -19
  63. dkg-8.0.2.dist-info/RECORD +82 -0
  64. {dkg-8.0.0a3.dist-info → dkg-8.0.2.dist-info}/WHEEL +1 -1
  65. dkg/asset.py +0 -912
  66. dkg/data/interfaces/AssertionStorage.json +0 -229
  67. dkg/data/interfaces/ContentAssetStorage.json +0 -706
  68. dkg/data/interfaces/ServiceAgreementStorageProxy.json +0 -1314
  69. dkg/graph.py +0 -63
  70. dkg-8.0.0a3.dist-info/RECORD +0 -52
  71. {dkg-8.0.0a3.dist-info → dkg-8.0.2.dist-info}/LICENSE +0 -0
  72. {dkg-8.0.0a3.dist-info → dkg-8.0.2.dist-info}/NOTICE +0 -0
dkg/graph.py DELETED
@@ -1,63 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
-
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
- from rdflib.plugins.sparql.parser import parseQuery
19
-
20
- from dkg.dataclasses import NodeResponseDict
21
- from dkg.exceptions import OperationNotFinished
22
- from dkg.manager import DefaultRequestManager
23
- from dkg.method import Method
24
- from dkg.module import Module
25
- from dkg.types import NQuads
26
- from dkg.utils.decorators import retry
27
- from dkg.utils.node_request import NodeRequest, validate_operation_status
28
-
29
-
30
- class Graph(Module):
31
- def __init__(self, manager: DefaultRequestManager):
32
- self.manager = manager
33
-
34
- _query = Method(NodeRequest.query)
35
- _get_operation_result = Method(NodeRequest.get_operation_result)
36
-
37
- def query(
38
- self,
39
- query: str,
40
- repository: str,
41
- ) -> NQuads:
42
- parsed_query = parseQuery(query)
43
- query_type = parsed_query[1].name.replace("Query", "").upper()
44
-
45
- operation_id: NodeResponseDict = self._query(query, query_type, repository)[
46
- "operationId"
47
- ]
48
- operation_result = self.get_operation_result(operation_id, "query")
49
-
50
- return operation_result["data"]
51
-
52
- @retry(catch=OperationNotFinished, max_retries=5, base_delay=1, backoff=2)
53
- def get_operation_result(
54
- self, operation_id: str, operation: str
55
- ) -> NodeResponseDict:
56
- operation_result = self._get_operation_result(
57
- operation_id=operation_id,
58
- operation=operation,
59
- )
60
-
61
- validate_operation_status(operation_result)
62
-
63
- return operation_result
@@ -1,52 +0,0 @@
1
- dkg/__init__.py,sha256=2pZEIrpDODunXXZmcLuKLWUrTrWLlYj10f11VzK5oLs,108
2
- dkg/assertion.py,sha256=Sp7mqLHuR588CRZ5JpMVDS2U0yOcwg-qbBl4xYOtRH8,2490
3
- dkg/asset.py,sha256=VgJYLQuh59rXi9KyC5_z7tJ-KIci7-IB3LJRftu_m0w,34180
4
- dkg/constants.py,sha256=5iJxaObYAz5xdOFaHmNgfSNsHk9YPEAbFsWzvO4uEpA,2131
5
- dkg/data/interfaces/AssertionStorage.json,sha256=WNvimMROngLiDmu4t-mn9wNDPPvrvEOkMYFfF8ayui4,4346
6
- dkg/data/interfaces/ContentAsset.json,sha256=us75W__5zwC2S-4GfGV1UdNgpRVZuz4Abs4oQAXEqUM,14000
7
- dkg/data/interfaces/ContentAssetStorage.json,sha256=RYq6KqnPheJNDLmoT5EgQi1Ekvg-qaICZGZA1jZUkrE,13189
8
- dkg/data/interfaces/Hub.json,sha256=P3PJbD5pfHDtUOrCNnHnEDGHFny6-zV1oyqbrGhzvXE,6896
9
- dkg/data/interfaces/IdentityStorage.json,sha256=0wa0XXiHu119KapP5hxPp_4uwDkK5DzhSrUkgHVVYLs,6429
10
- dkg/data/interfaces/Paranet.json,sha256=YOUmIculqkynaAtUhbdGmmRv9LF143BpCdCikAgX1PU,32893
11
- dkg/data/interfaces/ParanetIncentivesPoolFactory.json,sha256=NproHkeL32nrYJnQfmkAkKotIprnQ-aZfUEMlcE0HgM,3998
12
- dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json,sha256=vwFOzi7yZMb4kecCe-DGImIPSVWLVX0dDTekMOdPE2E,18897
13
- dkg/data/interfaces/ParanetNeurowebIncentivesPool.json,sha256=wB5ERWn3zbMuud6vEnS21MPd0wzmK5Xb7NMEQRasvIY,21970
14
- dkg/data/interfaces/ParanetsRegistry.json,sha256=u3RaHsrm_F_is4Uu6DwtOd3bxwUakPvtva5hZuKdBC0,33362
15
- dkg/data/interfaces/ServiceAgreementStorageProxy.json,sha256=QOBRUc1mFp7I4BeJfSctsuVBygRc7dGYKqb4ApMoCL0,26028
16
- dkg/data/interfaces/Token.json,sha256=vvTgWTyhjMa5Q-v7fOM4zVH5m_TVdahP14JQMk9gzxw,10912
17
- dkg/dataclasses.py,sha256=pOV0LzuNOTDsr48JGq_2H6BD7ISS4ZxOn2HGl9MjSyM,1906
18
- dkg/exceptions.py,sha256=LiEhCVKw-jCJcyCNRjHZGKxZoljOKwLNV-9q7EPZkak,3756
19
- dkg/graph.py,sha256=YVMjJ2BA7KgNxXKammRTRLQtHBsWwY_dqzs_4-seFB0,2248
20
- dkg/main.py,sha256=QX3QFvU_HLfj4WrAleguCMLGvDkzDSZegcZkjCeequs,2857
21
- dkg/manager.py,sha256=cT0dgkpOVphfodzO9ncXZxNu26zet6ED5XfIXORpLog,2627
22
- dkg/method.py,sha256=E14K2UWe7lfnuwOIWW5AQSqJfmgjZ6jdn0YeX88qnWc,5415
23
- dkg/module.py,sha256=Nh9IYLOqJKURf_1dYGFGlis7G-xOg9wwL2wzDAm5Yfw,2566
24
- dkg/network.py,sha256=MjVIWiGLBROXq4uANM_CmFN7x-K7mUg1VpU5Gj1n5_A,2165
25
- dkg/node.py,sha256=CgNOp5mn6r3kQd4Axr6HS_a45gkaDYZ3nRCu1TqMxNc,1478
26
- dkg/paranet.py,sha256=Pvs4KpedMb01WqBR05blghYe6C1ibiI8x6ZKFpuI-As,27062
27
- dkg/providers/__init__.py,sha256=Z3Wp3ap4U4mnFgMQx8A-oyUdUAKrl3WKxGLYX15aj4s,99
28
- dkg/providers/blockchain.py,sha256=PCggYatXyLs4DFauupTfistg0TOFGipv1T6CTTMOIzU,11002
29
- dkg/providers/node_http.py,sha256=9pxUiIRDKlGMNHOqP0SJO178B9MkBekfMJyePVSXOFA,2393
30
- dkg/types/__init__.py,sha256=Zh2jqs7Szqoj4Epr9mnBODOwxQDVTnvfxMog6Rbt49U,578
31
- dkg/types/blockchain.py,sha256=hsBpFLgpcEmgODLK0g_cUW1AB69ZZYeX4AcW6wpAMtA,1682
32
- dkg/types/dkg_node.py,sha256=uGjaYUO4D55sHJrL_3aOL3Nul3RlAo_aL4HLoSrQxr0,838
33
- dkg/types/encoding.py,sha256=gOtt9XLoxs6TE7rOCrAx-aCOdsDdaTVn3bxu9HPavxc,915
34
- dkg/types/evm.py,sha256=gN2hSq4MQzobWE3YAiTZPcv5b65AVyUEQut8hWPnx68,971
35
- dkg/types/general.py,sha256=7SnOqQ9iFjYaXgs7qc3_SxN9ygI-rIoK6vQU6LJZ8og,1539
36
- dkg/types/generics.py,sha256=9ZGFGWp4eN_5bGaWF6COtFMh228ZghjU1CmUok0fuds,907
37
- dkg/types/network.py,sha256=htNZ00Vrb-wMcR4_XI1tn_-0uVjDqcW7hhdHyjbyq1g,838
38
- dkg/types/rdf.py,sha256=qm1l7pqTLWBlSmaoQhmBg2qKS16eF83IcOnxuYPdiv8,851
39
- dkg/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- dkg/utils/blockchain_request.py,sha256=dHgpZUbHVqKrOL8ScAStrmivIJ7zR1pNiQKbDOpjsyI,12003
41
- dkg/utils/decorators.py,sha256=uUh0xI9wv1gE6JF44eYEfUPGSFEBLR6Ua5D9Dhc3s10,1566
42
- dkg/utils/merkle.py,sha256=924kloBAnCXydteVtWMj_QLP5CRJf2GbHMZ-lbIK0KE,5141
43
- dkg/utils/metadata.py,sha256=483OroYwGNfZ_cCXfH3-xUrZgiR4mjjo9iU_Ie5RYRs,1658
44
- dkg/utils/node_request.py,sha256=TTfU1BytlXWcz26S22rXoQG0vSRV0q3FNpwLWeJh9_I,5353
45
- dkg/utils/rdf.py,sha256=O1sbz8dqzyGRpJAUnQqAKsY_KsmB2DYGnFajbIX4b_0,2844
46
- dkg/utils/string_transformations.py,sha256=eR51fVwTF9QKxEqXo9_1Bfw_k8iQajdXD6rKuTvhs70,972
47
- dkg/utils/ual.py,sha256=g7PFyS4Sbwjmwkq-eB20uRULEC2wlPGZr31BVQjs5OQ,1569
48
- dkg-8.0.0a3.dist-info/LICENSE,sha256=Dr70w2zcW8-jrPGlpTTTlJPL8lR4j2zpDD32tdEFgjY,11375
49
- dkg-8.0.0a3.dist-info/METADATA,sha256=OmmZinqheAu-VwyLiEjArZQMSpkxiFbs-tucf7BbAHc,10650
50
- dkg-8.0.0a3.dist-info/NOTICE,sha256=Rk5toFR2ZqPwVZ3P_P4wE6U1xCnWR9KD3rNBqfPY7h8,368
51
- dkg-8.0.0a3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
52
- dkg-8.0.0a3.dist-info/RECORD,,
File without changes
File without changes