Metadata-Version: 2.4
Name: akadako
Version: 0.2.0
Summary: Python library for the AkaDako board (TFabWorks)
Author: TFabWorks
License: MIT
Project-URL: Homepage, https://akadako.com/
Project-URL: Documentation, https://tfabworks.github.io/akadako-python/
Project-URL: Repository, https://github.com/tfabworks/akadako-python
Keywords: akadako,scratch,education,iot,grove,firmata
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Education
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-rtmidi>=1.4
Provides-Extra: share
Requires-Dist: websockets>=10.0; extra == "share"
Dynamic: license-file

# akadako (Python)

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

- 📖 **マニュアル: https://tfabworks.github.io/akadako-python/**
- AkaDako ボードとは MIDI 上の Firmata プロトコルで通信します。

## インストール

```bash
pip install akadako
```

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

```bash
pip install "akadako[share]"
```

> ボードとの接続には [`python-rtmidi`](https://pypi.org/project/python-rtmidi/) を使用します（依存に含まれます）。

## クイックスタート

`akadako.js` が `async/await` 中心であるのと同様に、本ライブラリも `asyncio` を中心に設計されています。

```python
import asyncio
from akadako import AkaDako

async def main():
    board = await AkaDako.connect()          # 接続待ち
    board.on_disconnected(lambda: print("切断されました"))
    try:
        while board.is_connected:
            print("温度:", await board.fetch_temperature())
            print("明るさ:", await board.fetch_brightness())
            await asyncio.sleep(0.1)          # 負荷軽減
    finally:
        board.disconnect()

asyncio.run(main())
```

## JavaScript との対応

`akadako.js` の `camelCase` メソッドは Python では `snake_case` になります（例: `fetchTemperature()` → `fetch_temperature()`、`runServoTurn()` → `run_servo_turn()`）。
列挙やクラスは同名です（`AkaDako.Color` → `akadako.Color`、`AkaDako.DigitalRead` → `akadako.DigitalRead` など）。

詳細は[マニュアル](https://tfabworks.github.io/akadako-python/)を参照してください。

## ライセンス

MIT License
