Skip to main content

Python library for the AkaDako board (TFabWorks)

Project description

akadako (Python)

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

インストール

pip install akadako

ネットワーク通信(共有サーバ)機能も使う場合:

pip install "akadako[share]"

ボードとの接続には python-rtmidi を使用します(依存に含まれます)。

クイックスタート

本ライブラリは同期(ブロッキング)API です。akadako.jsasync/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.jscamelCase メソッドは Python では snake_case になります(例: fetchTemperature()fetch_temperature()runServoTurn()run_servo_turn())。 列挙やクラスは同名です(AkaDako.Colorakadako.ColorAkaDako.DigitalReadakadako.DigitalRead など)。

詳細はマニュアルを参照してください。

ライセンス

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

akadako-0.3.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

akadako-0.3.0-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file akadako-0.3.0.tar.gz.

File metadata

  • Download URL: akadako-0.3.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for akadako-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5ba7acb645e41941d0c5554b31c950032effa68b2cd85283695ad7c50c8a40fb
MD5 56e1b4dda6f04663dde5b83f4093f3cb
BLAKE2b-256 9886de5b318862d7aca731b1f05ccc3f29172eda526094572833203edb579367

See more details on using hashes here.

File details

Details for the file akadako-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: akadako-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for akadako-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86917b91e2ec4c1ab769d0fe807969fa6232f761f4c5e6976d417d20e943f641
MD5 5dcd1c8d1dffd13a66db153cfad15335
BLAKE2b-256 167240b56b6b3f0b709530bc63553171bb7531b76d7734710a9db879647b4e68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page