akadako (Python)
フィジカルコンピューティングデバイス AkaDako(TFabWorks)を Python から制御するためのライブラリです。 公式 JavaScript ライブラリ akadako.js と同じ API 設計を Python に移植しています。
- 📖 マニュアル: https://tfabworks.github.io/akadako-python/
- AkaDako ボードとは MIDI 上の Firmata プロトコルで通信します。
インストール
pip install akadako
ネットワーク通信(共有サーバ)機能も使う場合:
pip install "akadako[share]"
ボードとの接続には
python-rtmidiを使用します(依存に含まれます)。
クイックスタート
本ライブラリは同期(ブロッキング)API です。akadako.js は async/await 中心ですが、これはブラウザにブロッキング I/O が無いための制約で、Python ではその必要がありません。gpiozero などの Python フィジカルコンピューティング系ライブラリと同じく、await 無しでそのまま呼び出せます。
import time
from akadako import AkaDako
board = AkaDako.connect() # 接続(ブロッキング)
board.on_disconnected(lambda: print("切断されました"))
try:
while board.is_connected:
print("温度:", board.fetch_temperature())
print("明るさ:", board.fetch_brightness())
time.sleep(0.1) # 負荷軽減
finally:
board.disconnect()
JavaScript との対応
akadako.js の camelCase メソッドは Python では snake_case になります(例: fetchTemperature() → fetch_temperature()、runServoTurn() → run_servo_turn())。
列挙・値クラス・エラーは akadako.js と同じく AkaDako のメンバーとしても参照できます。from akadako import AkaDako だけで一通り使えます(個別に from akadako import ServoWrite, Color のように import することも可能)。
from akadako import AkaDako
board = AkaDako.connect()
board.run_servo_turn(AkaDako.ServoWrite.A1, 50, 90)
board.run_color_led_fill_color(AkaDako.ColorLed.A1, AkaDako.Color.RED)
利用できるメンバー: DigitalRead / DigitalReadPin / DigitalWrite / AnalogRead / ServoWrite / PwmWrite / ColorLed / IrRemoteWrite / PinBias / Color / Rainbow、および各種エラー(NotSupportedError など)。
詳細はマニュアルを参照してください。
ライセンス
MIT License
Metadata
Release files for akadako 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| akadako-1.0.1.tar.gz | 33.2 kB | Without provenance | Details for akadako-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akadako-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for akadako-1.0.1-py3-none-any.whl |
Total release size: 68.5 kB
Release files / akadako-1.0.1.tar.gz
| Download URL | akadako-1.0.1.tar.gz |
|---|---|
| Size | 33.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dbe49b6a0f28c1aa785462f1ec436ca4b75b8387d2e976c8e87d79c3636368d
|
|
BLAKE2b-256 checksum How to use checksums |
af934e613343d6d654b00b16e235f4aeb484bbfd82b7bd6dac6d9b1116d553cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|
Release files / akadako-1.0.1-py3-none-any.whl
| Download URL | akadako-1.0.1-py3-none-any.whl |
|---|---|
| Size | 35.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1868d18dff414e457e8755fc799aa4f3c686e3bb6b839b0eefd9897b1bc3a21e
|
|
BLAKE2b-256 checksum How to use checksums |
5a490175310c2a4a80e466ca3a91f5a2953500311f4f76cf5a620400a6d79c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|
Security for akadako 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.