Metadata-Version: 2.4
Name: pwi
Version: 0.4.0
Summary: Modern, type-safe, python library for controlling PlaneWave devices
Project-URL: Source, https://github.com/michealroberts/pwi
Project-URL: Issues, https://github.com/michealroberts/pwi/issues
Project-URL: PullRequests, https://github.com/michealroberts/pwi/pulls
Project-URL: Discussions, https://github.com/michealroberts/pwi/discussions
Author-email: michealroberts <michael@observerly.com>
License: MIT License
        
        Copyright (c) 2025 Michael J. Roberts
        
        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: astronomy,astrophotography,focuser,mount,observatory,planewave,pwi4,rotator,telescope
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.13
Requires-Dist: celerity>=0.27.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.10.6
Description-Content-Type: text/markdown

![pypi](https://img.shields.io/pypi/v/pwi.svg)
![versions](https://img.shields.io/pypi/pyversions/pwi.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![pwi/test](https://github.com/michealroberts/pwi/actions/workflows/test.yml/badge.svg)](https://github.com/michealroberts/pwi/actions/workflows/test.yml)

# PlaneWave Interface

Modern, type-safe, zero-dependency python library for controlling PlaneWave devices through the PWI4 HTTP interface.

## Installation

```bash
uv add pwi
```

or

using your preferred environment / package manager of choice, e.g., `poetry`, `conda` or `pip`:

```bash
pip install pwi
```

```bash
poetry add pwi
```

```bash
conda install pwi
```

## Usage

```python
from pwi import (
    BaseMountAlignmentMode,
    PlaneWaveHTTPXClient,
    PlaneWaveMountDeviceInterface,
    PlaneWaveMountDeviceParameters,
)

# Create a new PlaneWave HTTPX client:
client = PlaneWaveHTTPXClient(host="localhost", port=8220)

# Define the parameters for the PlaneWave Mount device:
params: PlaneWaveMountDeviceParameters = PlaneWaveMountDeviceParameters(
    name="PlaneWave L350 Alt-Az Mount",
    description="PlaneWave Mount Interface (HTTP)",
    alignment=BaseMountAlignmentMode.ALT_AZ,
    latitude=33.87047,
    longitude=-118.24708,
    elevation=0.0,
    did="0", # Device ID
    vid="",  # Vendor ID
    pid="",  # Product ID
)

# Create a new PlaneWave Mount device interface:
mount = PlaneWaveMountDeviceInterface(
    id=0,
    params=params,
    client=client,
)

# Initialise the mount:
mount.initialise()

# Get the current status of the mount:
status = mount.get_status()

...
```

As the pwi instance is fully typed, you can use your IDE's autocompletion to see all the available methods and properties.

We have also provided further usage examples in the [examples](./examples) directory.

## Milestones

- [X] Type-safe modern 3.6+ Python
- [X] Fully unit tested
- [X] Simpler API (modelled around the ASCOM Alpaca API)
- [X] Integration testing with HIL testing (hardware-in-the-loop)
- [X] Zero-external dependencies (no numpy, astropy etc for portability)
- [X] Example API usage
- [X] Fully supported PlaneWave Mount operations
- [ ] Fully supported PlaneWave Focuser operations
- [ ] Fully supported PlaneWave Rotator operations
- [X] Fully seasoned recipes for usage with numpy, astropy et al.
- [ ] ASCOM Alpaca APIs w/Fast API

---

### Disclaimer

This project is not affiliated with PlaneWave Instruments or observable.space in any way. It is a community-driven project. All trademarks and logos are the property of their respective owners. The PWI4 software is the property of PlaneWave Instruments.

### License

This project is licensed under the terms of the MIT license.
