Skip to main content

Python binding for the ZWO ASI SDK library

Project description

Header

PyZWOASI · Build status MIT License Starline counter

Overview

PyZWOASI is a lightweight, cross-platform Python binding for the ZWO ASI SDK, allowing you to control and stream data from all ZWO ASI USB cameras directly from Python.

The project provides:

  • A low-level ctypes wrapper exposing all original SDK functions
  • Full support for exposure, ROI, binning, video capture, etc.
  • Cross-platform DLL/SO/Dylib loading (Windows / Linux / macOS)
  • Example scripts for live view

It is designed to be simple to use for beginners, while remaining powerful enough for advanced users who require direct access to the underlying SDK.

Features

  • Easy-to-use Python interface class for ZWO ASI cameras ZWOCamera
  • Live-view with real-time frame display using OpenCV
  • Direct access to all ZWO ASI SDK functions (40 / 43)
    • Add function ASIGetVideoDataGPS
    • Add function ASIGetDataAfterExpGPS
    • Add function ASIGPSGetData
  • Cross-platform support (Windows, Linux, MacOS)

Installation

[!WARNING] If you are working on Windows, the ZWO USB driver must be installed on the system before the module can detect any camera. You can download the latest driver from the ZWO website > Software > Dekstop App > Windows > Camera Driver. If you are on Linux or MacOS, no additional driver installation is needed.

(Recommended) Using pip

The safest and easiest way to install up-to-date PyZWOASI is to use its repository from PyPI using pip :

pip install pyzwoasi

The installer will take in charge the machine configuration and choose the right compiled library files from ZWO. This means that you will not have useless .dll files on your machine, only the needed ones.

[!NOTE] Only installation from pip is currently supported. Installation from conda or other package managers is not available at the moment but will come. If you do not want to use pip, please follow the instructions below to install from source.

(Alternative) From source

If you want to be part of the development or simply if you want to install the module directly from the sources, you can also clone the repository and run pip from there:

git clone https://github.com/fmargall/pyzwoasi.git
cd pyzwoasi
pip install -e .

Quick start

First shot

import pyzwoasi

numOfConnectedCameras = pyzwoasi.getNumOfConnectedCameras()
if (numOfConnectedCameras == 0):
    print("No camera connected")
    exit()

for cameraIndex in range(numOfConnectedCameras):
    with ZWOCamera(cameraIndex) as camera:
        imageData = camera.shot(exposureTime_us = 1000) 

Live view

import pyzwoasi

numOfConnectedCameras = pyzwoasi.getNumOfConnectedCameras()
if (numOfConnectedCameras == 0):
    print("No camera connected")
    exit()

for cameraIndex in range(numOfConnectedCameras):
    with ZWOCamera(cameraIndex) as camera:
        camera.liveView()

Advanced usage

High-level access (ZWOCamera class)

The ZWOCamera class provides a high-level interface to interact with ZWO ASI cameras. It encapsulates common operations such as connecting to the camera, capturing images, and starting live view sessions.

Low-level access (Direct SDK function calls)

For advanced applications or scientific control, you can call the original ASI SDK functions directly. This is identical to the official C API, just wrapped for Python.

Contributing

Contributions are welcome! Whether you fix a bug, improve documentation, add support for new SDK functions, or propose new high-level APIs, feel free to open an issue or submit a pull request. Please follow the existing coding style and keep the project cross-platform.

Contributors

Contact

François Margall - fr.margall@proton.me

License

PyZWOASI is distributed under the MIT License. See LICENSE.txt for more information.

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

pyzwoasi-0.2.1.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

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

pyzwoasi-0.2.1-py3-none-any.whl (5.6 MB view details)

Uploaded Python 3

File details

Details for the file pyzwoasi-0.2.1.tar.gz.

File metadata

  • Download URL: pyzwoasi-0.2.1.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyzwoasi-0.2.1.tar.gz
Algorithm Hash digest
SHA256 267090b9c93c67f0a927c32ff2f7d485ce0857b90914c062bef8e117c8958653
MD5 ad77179ec4e5c76891b8247e01a767a3
BLAKE2b-256 3263ece188d0cc07dc50215812407a05e1bcc246d9aae718837b485e3ca2740d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyzwoasi-0.2.1.tar.gz:

Publisher: deployment.yml on fmargall/pyzwoasi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyzwoasi-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyzwoasi-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyzwoasi-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9914c0798606c05666f6d10ac15a8ed6fd5627efe00d7d0a07ecb7247c63df
MD5 198f45ed6d3b6a5ae3f5352e312f1a65
BLAKE2b-256 c6b6780621d12f91ca04e0866d58e1e8e46abe88e37eee08ce15a6355dc5ffdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyzwoasi-0.2.1-py3-none-any.whl:

Publisher: deployment.yml on fmargall/pyzwoasi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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