Skip to main content

akadako (Python)

フィジカルコンピューティングデバイス AkaDako(TFabWorks)を Python から制御するためのライブラリです。 公式 JavaScript ライブラリ akadako.js と同じ API 設計を Python に移植しています。

インストール

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)

Source distribution for akadako 1.0.1
File Size Uploaded
akadako-1.0.1.tar.gz 33.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for akadako 1.0.1
File Interpreter ABI Platform
akadako-1.0.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page