Metadata-Version: 2.4
Name: flashbay
Version: 0.1.0
Summary: Python SDK and pytest fixtures for flashbay hardware-in-the-loop testing
Project-URL: Homepage, https://flashbay.dev
Project-URL: Documentation, https://flashbay.dev/docs/guides/python-sdk
Project-URL: Repository, https://github.com/flashbay-dev/fbay-python
Author: RAWS Consulting
License-Expression: Apache-2.0
Keywords: HIL,MCU,embedded,hardware-in-the-loop,pytest,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Requires-Dist: websockets<15,>=13.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# flashbay

Python SDK for [flashbay](https://flashbay.dev) — remote access to MCU development boards.

Use it in scripts, automation, or as a pytest plugin for hardware-in-the-loop testing.

## Install

```bash
pip install flashbay
```

## Quick start

```python
from flashbay import Client

client = Client()

with client.session(board="esp32s3") as session:
    session.flash("firmware.bin")
    session.serial.expect("Ready", timeout=10)
    session.serial.send("status\n")
    print(session.serial.read_until("OK", timeout=5))
```

Or use the `Board` shorthand:

```python
from flashbay import Board

with Board("esp32-s3", firmware="build/app.bin") as board:
    board.expect("System ready", timeout=5)
    board.send("gpio set 4 1\n")
    board.expect("GPIO4=HIGH", timeout=2)
```

## pytest plugin

The package includes a pytest plugin that registers automatically. Use it with custom fixtures:

```python
import pytest
from flashbay import Board

@pytest.fixture
def board():
    with Board("esp32-s3", firmware="build/app.bin") as b:
        yield b

def test_boot_ok(board):
    assert board.expect("System ready", timeout=5)
```

Or use the built-in `flashbay_board` fixture via CLI options:

```bash
pytest --flashbay-board esp32s3 --flashbay-firmware build/app.bin tests/hil/
```

## Authentication

Set your API key via environment variable:

```bash
export FLASHBAY_API_KEY=key_...
```

Or pass it directly:

```python
client = Client(api_key="key_...")
```

## Documentation

- [Python SDK guide](https://flashbay.dev/docs/guides/python-sdk)
- [CI/CD integration](https://flashbay.dev/docs/guides/cicd)
