Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit a452c5f

Browse files
committed
Added docstrings
1 parent ecba85b commit a452c5f

File tree

23 files changed

+63
-2
lines changed

23 files changed

+63
-2
lines changed

docs/mkdocs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
site_name: Python3 SDK | make87
22
docs_dir: src
33
nav:
4-
- Home: index.md
5-
- API Reference: reference/
4+
- API Reference:
5+
- make87: reference/index.md
6+
- config: reference/config.md
7+
- encodings: reference/encodings/index.md
8+
- host: reference/host.md
9+
- interfaces: reference/interfaces/index.md
10+
- models: reference/models/index.md
11+
- peripherals: reference/peripherals/index.md
12+
- storage: reference/storage.md
13+
614
plugins:
715
- search:
816
lang:

make87/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def run_forever() -> None:
5454
calling this function.
5555
5656
Example:
57+
5758
>>> import make87
5859
>>> # Set up your application components here
5960
>>> make87.run_forever() # Blocks until signal received

make87/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def load_config_from_env(var: str = CONFIG_ENV_VAR) -> ApplicationConfig:
6666
RuntimeError: If the environment variable is missing or contains invalid JSON.
6767
6868
Example:
69+
6970
>>> import os
7071
>>> os.environ["MAKE87_CONFIG"] = '{"application_info": {...}, "config": {...}}'
7172
>>> config = load_config_from_env()
@@ -95,6 +96,7 @@ def load_config_from_json(json_data: Union[str, Dict]) -> ApplicationConfig:
9596
TypeError: If json_data is neither a string nor a dictionary.
9697
9798
Example:
99+
98100
>>> config_dict = {"application_info": {...}, "config": {...}}
99101
>>> config = load_config_from_json(config_dict)
100102
>>> config_json = '{"application_info": {...}, "config": {...}}'
@@ -141,6 +143,7 @@ def get_config_value(
141143
KeyError: If the configuration key is not found and no default is provided.
142144
143145
Example:
146+
144147
>>> config = load_config_from_env()
145148
>>> port = get_config_value(config, "port", default=8080, converter=int)
146149
>>> debug = get_config_value(config, "debug", default=False, converter=bool)

make87/encodings/json_.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(
3939
a JSON-serializable object or raise TypeError.
4040
4141
Example:
42+
4243
>>> # Simple encoder
4344
>>> encoder = JsonEncoder()
4445
>>>
@@ -70,6 +71,7 @@ def encode(self, obj: T) -> bytes:
7071
or other serialization errors
7172
7273
Example:
74+
7375
>>> encoder = JsonEncoder()
7476
>>> data = {"key": "value", "number": 42}
7577
>>> encoded = encoder.encode(data)
@@ -95,6 +97,7 @@ def decode(self, data: bytes) -> T:
9597
or encoding issues
9698
9799
Example:
100+
98101
>>> encoder = JsonEncoder()
99102
>>> data = b'{"key": "value", "number": 42}'
100103
>>> decoded = encoder.decode(data)

make87/encodings/protobuf/pb4.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self, message_type: Type[T]) -> None:
3434
This must be a subclass of google.protobuf.message.Message.
3535
3636
Example:
37+
3738
>>> from my_protos import MyMessage
3839
>>> encoder = ProtobufEncoder(MyMessage)
3940
>>>
@@ -57,6 +58,7 @@ def encode(self, obj: T) -> bytes:
5758
TypeError: If the object is not an instance of the configured message type
5859
5960
Example:
61+
6062
>>> encoder = ProtobufEncoder(MyMessage)
6163
>>> message = MyMessage()
6264
>>> message.name = "example"
@@ -78,6 +80,7 @@ def decode(self, data: bytes) -> T:
7880
as a valid protobuf message of the configured type
7981
8082
Example:
83+
8184
>>> encoder = ProtobufEncoder(MyMessage)
8285
>>> data = b'\\x08\\x96\\x01' # Some protobuf-encoded bytes
8386
>>> message = encoder.decode(data)

make87/encodings/protobuf/pb5.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self, message_type: Type[T]) -> None:
3434
This must be a subclass of google.protobuf.message.Message.
3535
3636
Example:
37+
3738
>>> from my_protos import MyMessage
3839
>>> encoder = ProtobufEncoder(MyMessage)
3940
>>>
@@ -57,6 +58,7 @@ def encode(self, obj: T) -> bytes:
5758
TypeError: If the object is not an instance of the configured message type
5859
5960
Example:
61+
6062
>>> encoder = ProtobufEncoder(MyMessage)
6163
>>> message = MyMessage()
6264
>>> message.name = "example"
@@ -78,6 +80,7 @@ def decode(self, data: bytes) -> T:
7880
as a valid protobuf message of the configured type
7981
8082
Example:
83+
8184
>>> encoder = ProtobufEncoder(MyMessage)
8285
>>> data = b'\\x08\\x96\\x01' # Some protobuf-encoded bytes
8386
>>> message = encoder.decode(data)

make87/encodings/protobuf/pb6.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self, message_type: Type[T]) -> None:
3434
This must be a subclass of google.protobuf.message.Message.
3535
3636
Example:
37+
3738
>>> from my_protos import MyMessage
3839
>>> encoder = ProtobufEncoder(MyMessage)
3940
>>>
@@ -57,6 +58,7 @@ def encode(self, obj: T) -> bytes:
5758
TypeError: If the object is not an instance of the configured message type
5859
5960
Example:
61+
6062
>>> encoder = ProtobufEncoder(MyMessage)
6163
>>> message = MyMessage()
6264
>>> message.name = "example"
@@ -78,6 +80,7 @@ def decode(self, data: bytes) -> T:
7880
as a valid protobuf message of the configured type
7981
8082
Example:
83+
8184
>>> encoder = ProtobufEncoder(MyMessage)
8285
>>> data = b'\\x08\\x96\\x01' # Some protobuf-encoded bytes
8386
>>> message = encoder.decode(data)

make87/encodings/yaml_.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def __init__(self, *, loader: Optional[type] = None, dumper: Optional[type] = No
3535
Defaults to yaml.SafeDumper for security.
3636
3737
Example:
38+
3839
>>> # Simple encoder with safe defaults
3940
>>> encoder = YamlEncoder()
4041
>>>
@@ -61,6 +62,7 @@ def encode(self, obj: T) -> bytes:
6162
or other serialization errors
6263
6364
Example:
65+
6466
>>> encoder = YamlEncoder()
6567
>>> data = {"key": "value", "items": [1, 2, 3]}
6668
>>> encoded = encoder.encode(data)
@@ -90,6 +92,7 @@ def decode(self, data: bytes) -> T:
9092
or encoding issues
9193
9294
Example:
95+
9396
>>> encoder = YamlEncoder()
9497
>>> yaml_data = b'key: value\\nitems:\\n- 1\\n- 2\\n- 3\\n'
9598
>>> decoded = encoder.decode(yaml_data)

make87/host.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def host_is_updating() -> bool:
2323
If the file exists, it indicates that an update is in progress.
2424
2525
Example:
26+
2627
>>> import make87.host
2728
>>> if make87.host.host_is_updating():
2829
... print("Host is updating, waiting...")

make87/interfaces/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def get_interface_type_by_name(
9999
NotImplementedError: If the interface type is not supported
100100
101101
Example:
102+
102103
>>> interface = SomeInterface("my_interface")
103104
>>> pub_config = interface.get_interface_type_by_name("output", "PUB")
104105
>>> sub_config = interface.get_interface_type_by_name("input", "SUB")

0 commit comments

Comments
 (0)