Metadata-Version: 2.4
Name: awire
Version: 0.1.2
Summary: Python bindings for AlphaWire - Sony camera tethered control
Project-URL: Homepage, https://github.com/watsonmw/alphawire
Project-URL: Repository, https://github.com/watsonmw/alphawire
Project-URL: Issues, https://github.com/watsonmw/alphawire/issues
Author: Mark Watson
License: Copyright (c) 2026 Mark Watson
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: alpha,camera,control,ptp,sony,tethered
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics :: Capture :: Digital Camera
Requires-Python: >=3.9
Requires-Dist: cffi>=1.15.0
Description-Content-Type: text/markdown


# awire

Python bindings for [AlphaWire](https://github.com/watsonmw/alphawire) - a C library for Sony Alpha camera tethered control.

## Overview

`awire` provides a convenient Python interface to control Sony Alpha cameras via USB or IP connections. It is based on the AlphaWire C library, which focuses on minimal dependencies and broad camera support.

### Features
- **Fast and lightweight**: Minimal overhead for camera control.
- **Broad Compatibility**: Supports both pre-2020 and post-2020 Sony Alpha cameras.
- **Full Control**: Access to PTP device properties and camera settings.
- **Tethered Capture**: Trigger captures and download images directly.
- **Live View**: Real-time streaming support.

## Installation

   ```bash
   pip install awire
   ```

## Quick Start

### List Connected Cameras

```python
import awire
import time

def main():
    # Set logging level (optional)
    awire.log_set_level(awire.AwLogLevel.INFO)

    # Initialize device list
    device_list = awire.AwDeviceList()
    if not device_list.open():
        return

    # Start searching for cameras
    device_list.refresh()

    # Wait for discovery (or poll in a loop)
    while device_list.is_refreshing():
        device_list.poll_updates()
        time.sleep(0.1)

    # List found devices
    for device in device_list:
        print(f"Found: {device.manufacturer} {device.product} (S/N: {device.serial})")

    device_list.close()

if __name__ == "__main__":
    main()
```

## Development

To build and install the package in development mode:

1. **Install Build Dependencies**:
   ```bash
   pip install --upgrade build setuptools cffi
   ```

2. **Build the C extension**:
   ```bash
   python build_extension.py --debug
   ```
   On Windows, this enables native debug symbols and disables optimization while using the regular Python runtime; a debug build of Python is not required.

3. **Install in editable mode**:
   ```bash
   pip install -e .
   ```

### Building Wheels

   ```bash
   python -m build
   ```

## Compatibility

The package is built using the Python Stable ABI (Limited API), meaning a single wheel should work on all CPython versions from 3.9 onwards for a given platform.

## License

MIT License. See the main [LICENSE](../LICENSE) file for details.

> **Note**: This project is not affiliated with or endorsed by Sony. 'Sony' and 'Alpha' are trademarks or registered trademarks of Sony Corporation.
