akadako 0.2.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.
akadako-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TFabWorks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
akadako-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: akadako
3
+ Version: 0.2.0
4
+ Summary: Python library for the AkaDako board (TFabWorks)
5
+ Author: TFabWorks
6
+ License: MIT
7
+ Project-URL: Homepage, https://akadako.com/
8
+ Project-URL: Documentation, https://tfabworks.github.io/akadako-python/
9
+ Project-URL: Repository, https://github.com/tfabworks/akadako-python
10
+ Keywords: akadako,scratch,education,iot,grove,firmata
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Education
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Topic :: Education
18
+ Classifier: Topic :: System :: Hardware
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: python-rtmidi>=1.4
23
+ Provides-Extra: share
24
+ Requires-Dist: websockets>=10.0; extra == "share"
25
+ Dynamic: license-file
26
+
27
+ # akadako (Python)
28
+
29
+ フィジカルコンピューティングデバイス **AkaDako**(TFabWorks)を Python から制御するためのライブラリです。
30
+ 公式 JavaScript ライブラリ [akadako.js](https://akadako.com/javascript/) と同じ API 設計を Python に移植しています。
31
+
32
+ - 📖 **マニュアル: https://tfabworks.github.io/akadako-python/**
33
+ - AkaDako ボードとは MIDI 上の Firmata プロトコルで通信します。
34
+
35
+ ## インストール
36
+
37
+ ```bash
38
+ pip install akadako
39
+ ```
40
+
41
+ ネットワーク通信(共有サーバ)機能も使う場合:
42
+
43
+ ```bash
44
+ pip install "akadako[share]"
45
+ ```
46
+
47
+ > ボードとの接続には [`python-rtmidi`](https://pypi.org/project/python-rtmidi/) を使用します(依存に含まれます)。
48
+
49
+ ## クイックスタート
50
+
51
+ `akadako.js` が `async/await` 中心であるのと同様に、本ライブラリも `asyncio` を中心に設計されています。
52
+
53
+ ```python
54
+ import asyncio
55
+ from akadako import AkaDako
56
+
57
+ async def main():
58
+ board = await AkaDako.connect() # 接続待ち
59
+ board.on_disconnected(lambda: print("切断されました"))
60
+ try:
61
+ while board.is_connected:
62
+ print("温度:", await board.fetch_temperature())
63
+ print("明るさ:", await board.fetch_brightness())
64
+ await asyncio.sleep(0.1) # 負荷軽減
65
+ finally:
66
+ board.disconnect()
67
+
68
+ asyncio.run(main())
69
+ ```
70
+
71
+ ## JavaScript との対応
72
+
73
+ `akadako.js` の `camelCase` メソッドは Python では `snake_case` になります(例: `fetchTemperature()` → `fetch_temperature()`、`runServoTurn()` → `run_servo_turn()`)。
74
+ 列挙やクラスは同名です(`AkaDako.Color` → `akadako.Color`、`AkaDako.DigitalRead` → `akadako.DigitalRead` など)。
75
+
76
+ 詳細は[マニュアル](https://tfabworks.github.io/akadako-python/)を参照してください。
77
+
78
+ ## ライセンス
79
+
80
+ MIT License
@@ -0,0 +1,54 @@
1
+ # akadako (Python)
2
+
3
+ フィジカルコンピューティングデバイス **AkaDako**(TFabWorks)を Python から制御するためのライブラリです。
4
+ 公式 JavaScript ライブラリ [akadako.js](https://akadako.com/javascript/) と同じ API 設計を Python に移植しています。
5
+
6
+ - 📖 **マニュアル: https://tfabworks.github.io/akadako-python/**
7
+ - AkaDako ボードとは MIDI 上の Firmata プロトコルで通信します。
8
+
9
+ ## インストール
10
+
11
+ ```bash
12
+ pip install akadako
13
+ ```
14
+
15
+ ネットワーク通信(共有サーバ)機能も使う場合:
16
+
17
+ ```bash
18
+ pip install "akadako[share]"
19
+ ```
20
+
21
+ > ボードとの接続には [`python-rtmidi`](https://pypi.org/project/python-rtmidi/) を使用します(依存に含まれます)。
22
+
23
+ ## クイックスタート
24
+
25
+ `akadako.js` が `async/await` 中心であるのと同様に、本ライブラリも `asyncio` を中心に設計されています。
26
+
27
+ ```python
28
+ import asyncio
29
+ from akadako import AkaDako
30
+
31
+ async def main():
32
+ board = await AkaDako.connect() # 接続待ち
33
+ board.on_disconnected(lambda: print("切断されました"))
34
+ try:
35
+ while board.is_connected:
36
+ print("温度:", await board.fetch_temperature())
37
+ print("明るさ:", await board.fetch_brightness())
38
+ await asyncio.sleep(0.1) # 負荷軽減
39
+ finally:
40
+ board.disconnect()
41
+
42
+ asyncio.run(main())
43
+ ```
44
+
45
+ ## JavaScript との対応
46
+
47
+ `akadako.js` の `camelCase` メソッドは Python では `snake_case` になります(例: `fetchTemperature()` → `fetch_temperature()`、`runServoTurn()` → `run_servo_turn()`)。
48
+ 列挙やクラスは同名です(`AkaDako.Color` → `akadako.Color`、`AkaDako.DigitalRead` → `akadako.DigitalRead` など)。
49
+
50
+ 詳細は[マニュアル](https://tfabworks.github.io/akadako-python/)を参照してください。
51
+
52
+ ## ライセンス
53
+
54
+ MIT License
@@ -0,0 +1,64 @@
1
+ """
2
+ akadako - Python library for the AkaDako board (TFabWorks).
3
+
4
+ API design based on the official JavaScript library (akadako.js):
5
+ https://akadako.com/javascript/
6
+
7
+ Example:
8
+ import asyncio
9
+ from akadako import AkaDako
10
+
11
+ async def main():
12
+ board = await AkaDako.connect()
13
+ try:
14
+ print(await board.fetch_temperature())
15
+ finally:
16
+ board.disconnect()
17
+
18
+ asyncio.run(main())
19
+ """
20
+
21
+ from akadako.board import AkaDako
22
+ from akadako.constants import (
23
+ Color,
24
+ Rainbow,
25
+ ColorLed,
26
+ DigitalRead,
27
+ DigitalReadPin,
28
+ DigitalWrite,
29
+ AnalogRead,
30
+ PwmWrite,
31
+ ServoWrite,
32
+ PinBias,
33
+ IrRemoteWrite,
34
+ )
35
+ from akadako.errors import (
36
+ AkaDakoError,
37
+ NotSupportedError,
38
+ DisconnectedError,
39
+ InvalidValueError,
40
+ InvalidConnectorError,
41
+ BusyError,
42
+ )
43
+
44
+ __version__ = "0.2.0"
45
+ __all__ = [
46
+ "AkaDako",
47
+ "Color",
48
+ "Rainbow",
49
+ "ColorLed",
50
+ "DigitalRead",
51
+ "DigitalReadPin",
52
+ "DigitalWrite",
53
+ "AnalogRead",
54
+ "PwmWrite",
55
+ "ServoWrite",
56
+ "PinBias",
57
+ "IrRemoteWrite",
58
+ "AkaDakoError",
59
+ "NotSupportedError",
60
+ "DisconnectedError",
61
+ "InvalidValueError",
62
+ "InvalidConnectorError",
63
+ "BusyError",
64
+ ]