koi-net 1.0.0b15__py3-none-any.whl → 1.0.0b16__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 koi-net might be problematic. Click here for more details.

koi_net/config.py CHANGED
@@ -40,7 +40,7 @@ class EnvConfig(BaseModel):
40
40
  return env_val
41
41
  return value
42
42
 
43
- class Config(BaseModel):
43
+ class NodeConfig(BaseModel):
44
44
  server: ServerConfig | None = Field(default_factory=ServerConfig)
45
45
  koi_net: KoiNetConfig
46
46
  _file_path: str = PrivateAttr(default="config.yaml")
@@ -49,7 +49,7 @@ class Config(BaseModel):
49
49
  @classmethod
50
50
  def load_from_yaml(
51
51
  cls,
52
- file_path: str | None = None,
52
+ file_path: str = "config.yaml",
53
53
  generate_missing: bool = True
54
54
  ):
55
55
  yaml = YAML()
@@ -62,8 +62,14 @@ class Config(BaseModel):
62
62
  config._file_content = file_content
63
63
 
64
64
  except FileNotFoundError:
65
+ # empty_fields = {}
66
+ # for name, field in cls.model_fields.items():
67
+
68
+ # if field.default is None or field.default_factory is None:
69
+ # print(empty_fields)
65
70
  config = cls()
66
71
 
72
+
67
73
  config._file_path = file_path
68
74
 
69
75
  if generate_missing:
@@ -92,4 +98,4 @@ class Config(BaseModel):
92
98
  f.write(self._file_content)
93
99
  raise e
94
100
 
95
- ConfigType = TypeVar("ConfigType", bound=Config)
101
+ ConfigType = TypeVar("ConfigType", bound=NodeConfig)
koi_net/identity.py CHANGED
@@ -3,7 +3,7 @@ from rid_lib.ext.bundle import Bundle
3
3
  from rid_lib.ext.cache import Cache
4
4
  from rid_lib.types.koi_net_node import KoiNetNode
5
5
 
6
- from .config import Config
6
+ from .config import NodeConfig
7
7
  from .protocol.node import NodeProfile
8
8
 
9
9
  logger = logging.getLogger(__name__)
@@ -12,12 +12,12 @@ logger = logging.getLogger(__name__)
12
12
  class NodeIdentity:
13
13
  """Represents a node's identity (RID, profile, bundle)."""
14
14
 
15
- config: Config
15
+ config: NodeConfig
16
16
  cache: Cache
17
17
 
18
18
  def __init__(
19
19
  self,
20
- config: Config,
20
+ config: NodeConfig,
21
21
  cache: Cache
22
22
  ):
23
23
  """Initializes node identity from a name and profile.
@@ -15,7 +15,7 @@ from ..protocol.node import NodeType
15
15
  from ..protocol.edge import EdgeType
16
16
  from ..protocol.event import Event
17
17
  from ..identity import NodeIdentity
18
- from ..config import Config, ConfigType
18
+ from ..config import ConfigType
19
19
 
20
20
  logger = logging.getLogger(__name__)
21
21
 
@@ -9,7 +9,7 @@ from rid_lib.types.koi_net_node import KoiNetNode
9
9
  from ..identity import NodeIdentity
10
10
  from ..network import NetworkInterface
11
11
  from ..protocol.event import Event, EventType
12
- from ..config import Config
12
+ from ..config import NodeConfig
13
13
  from .handler import (
14
14
  KnowledgeHandler,
15
15
  HandlerType,
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
28
28
  class ProcessorInterface():
29
29
  """Provides access to this node's knowledge processing pipeline."""
30
30
 
31
- config: Config
31
+ config: NodeConfig
32
32
  cache: Cache
33
33
  network: NetworkInterface
34
34
  identity: NodeIdentity
@@ -39,7 +39,7 @@ class ProcessorInterface():
39
39
 
40
40
  def __init__(
41
41
  self,
42
- config: Config,
42
+ config: NodeConfig,
43
43
  cache: Cache,
44
44
  network: NetworkInterface,
45
45
  identity: NodeIdentity,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: koi-net
3
- Version: 1.0.0b15
3
+ Version: 1.0.0b16
4
4
  Summary: Implementation of KOI-net protocol in Python
5
5
  Project-URL: Homepage, https://github.com/BlockScience/koi-net/
6
6
  Author-email: Luke Miller <luke@block.science>
@@ -1,16 +1,16 @@
1
1
  koi_net/__init__.py,sha256=b0Ze0pZmJAuygpWUFHM6Kvqo3DkU_uzmkptv1EpAArw,31
2
- koi_net/config.py,sha256=4Lglj9mz9i4ratUXypdrLTuI1RHUOYeal9n8RKdVP7A,2911
2
+ koi_net/config.py,sha256=35RNSOcWxnJzasPAkYabFWcKyDR-2kM1NTrq_fYOkm0,3153
3
3
  koi_net/core.py,sha256=IO8kqiNMYVeuNzilq7eHBA7IulsxRjrCbWnIAx6_abA,4406
4
- koi_net/identity.py,sha256=Ro6iGw9DMc4KrLJyqejtdh9l872nCoCGc5ioF9OptJc,1276
4
+ koi_net/identity.py,sha256=muc5vuQ8zUOebhwAB3-ql6W2pgQETiYXXQAFBv8bLyg,1288
5
5
  koi_net/network/__init__.py,sha256=r_RN-q_mDYC-2RAkN-lJoMUX76TXyfEUc_MVKW87z0g,39
6
6
  koi_net/network/graph.py,sha256=dsfPuHUTkCzlj0QeL0e7dgp7-FR5_AGP7eE8EpBPhC0,4710
7
- koi_net/network/interface.py,sha256=DhMbVjKp9xdZReKldHWh72jkhd3RS_Q4XeNqg42mwyM,10474
7
+ koi_net/network/interface.py,sha256=CKZACkUxG6Y4GV8XR16lhFLzRpXOw59hx7sFewZ_35w,10466
8
8
  koi_net/network/request_handler.py,sha256=66gjX2x4UnBWZYwKLjp_3WkhL-ekhR3VAyfGviHTcUs,4790
9
9
  koi_net/network/response_handler.py,sha256=CAwici2Etj9ESndERXdtYkMlc4gWHz_xc7jHgY2Qjcg,1830
10
10
  koi_net/processor/__init__.py,sha256=x4fAY0hvQEDcpfdTB3POIzxBQjYAtn0qQazPo1Xm0m4,41
11
11
  koi_net/processor/default_handlers.py,sha256=f8Yl21lLGMa_oW51bf8sBuunfP9_rmiSu32T-rZ4kUY,8542
12
12
  koi_net/processor/handler.py,sha256=7X6M6PP8m6-xdtsP1y4QO83g_MN5VSszNNikprITK80,2523
13
- koi_net/processor/interface.py,sha256=Ecy0XWW7KfuDBFt7fXEmag4CzHP768mtO4uRZWNZN4E,13000
13
+ koi_net/processor/interface.py,sha256=3ofjBFz3FVjESABXJ1aC_4ESTuLFMHyl5d8uWz5QsFA,13012
14
14
  koi_net/processor/knowledge_object.py,sha256=RCgzkILsWm1Jw_NkSu4jTRYA9Ugga6mJ4jqKWwketQs,4090
15
15
  koi_net/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  koi_net/protocol/api_models.py,sha256=DYDKCRD2Uja633bBAyTsaxyb1oF9pX9yQ9NpNAbkczo,1070
@@ -19,7 +19,7 @@ koi_net/protocol/edge.py,sha256=CcmvIY4P1HEBdKNJ4wFRDmwYMRMss24Besmbi7ZRFxQ,427
19
19
  koi_net/protocol/event.py,sha256=HxzLN-iCXPyr2YzrswMIkgZYeUdFbBpa5v98dAB06lQ,1328
20
20
  koi_net/protocol/helpers.py,sha256=8ZkQrjb_G0QEaMIKe9wkFOBonl1bkmemx_pwKMwIiLg,695
21
21
  koi_net/protocol/node.py,sha256=2HhCh3LdBLlY2Z_kXNmKHzpVLKbP_ODob3HjHayFQtM,375
22
- koi_net-1.0.0b15.dist-info/METADATA,sha256=j7imUyTL-YbiIb4oL6j2jD2hd7dna35ya_mWGK2B2xE,34203
23
- koi_net-1.0.0b15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- koi_net-1.0.0b15.dist-info/licenses/LICENSE,sha256=03mgCL5qth2aD9C3F3qNVs4sFJSpK9kjtYCyOwdSp7s,1069
25
- koi_net-1.0.0b15.dist-info/RECORD,,
22
+ koi_net-1.0.0b16.dist-info/METADATA,sha256=YQ_kvSI7441neMoeU6uy5SMpt1Lo2ZwKx_KsIAbu0WE,34203
23
+ koi_net-1.0.0b16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ koi_net-1.0.0b16.dist-info/licenses/LICENSE,sha256=03mgCL5qth2aD9C3F3qNVs4sFJSpK9kjtYCyOwdSp7s,1069
25
+ koi_net-1.0.0b16.dist-info/RECORD,,