Python binding for the ZWO ASI SDK library
Project description
PyZWOASI ·
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
- Add function
- Cross-platform support (Windows, Linux, MacOS)
Installation
[!WARNING]
- Windows: install the ZWO USB driver from ZWO website > Software > Desktop App > Windows > Camera Driver before using the module.
- macOS: libusb is required. Install via Homebrew:
brew install libusb.- Linux: libusb is typically already available via your distribution packages.
(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
pipis currently supported. Installation fromcondaor other package managers is not available at the moment but will come. If you do not want to usepip, 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
from pyzwoasi import ZWOCamera
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
from pyzwoasi import ZWOCamera
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.
Frequently Asked Questions (FAQ)
Why is my camera not detected?
If you are on Windows, make sure you have installed the ZWO ASI Camera driver, as explained in the Installation section of this README. On macOS, ensure `libusb` is installed (`brew install libusb`). If this is the case or if you are on Linux or MacOS, most of the time the problem comes from a bad USB port or cable. Please try to change USB port and/or cable, especially if you are using a USB cable extension, try to remove it.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyzwoasi-0.2.6.tar.gz.
File metadata
- Download URL: pyzwoasi-0.2.6.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5123d809869900c8fca3ba588f31dbdea761776a98be3a7919253c7f9afd322b
|
|
| MD5 |
d7e4456e64faa11bd348d14f59694917
|
|
| BLAKE2b-256 |
633013e4d4a1875834d8ae23530e1f39da345683a356a6bab52351bf098b6f17
|
Provenance
The following attestation bundles were made for pyzwoasi-0.2.6.tar.gz:
Publisher:
deployment.yml on fmargall/pyzwoasi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyzwoasi-0.2.6.tar.gz -
Subject digest:
5123d809869900c8fca3ba588f31dbdea761776a98be3a7919253c7f9afd322b - Sigstore transparency entry: 1185522224
- Sigstore integration time:
-
Permalink:
fmargall/pyzwoasi@e74e222d85c776527ab318852b887f5b7dffbca8 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/fmargall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deployment.yml@e74e222d85c776527ab318852b887f5b7dffbca8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyzwoasi-0.2.6-py3-none-any.whl.
File metadata
- Download URL: pyzwoasi-0.2.6-py3-none-any.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff32470fb4a65806d345657121cf52a51b0db84c98c91758281e995c307d5d9b
|
|
| MD5 |
ddd85977ecea447643a50c5a26e9cafc
|
|
| BLAKE2b-256 |
4eee1bb28910079941e61cea611c2d987fa23abe37259e886d5ff1670aa7d825
|
Provenance
The following attestation bundles were made for pyzwoasi-0.2.6-py3-none-any.whl:
Publisher:
deployment.yml on fmargall/pyzwoasi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyzwoasi-0.2.6-py3-none-any.whl -
Subject digest:
ff32470fb4a65806d345657121cf52a51b0db84c98c91758281e995c307d5d9b - Sigstore transparency entry: 1185522231
- Sigstore integration time:
-
Permalink:
fmargall/pyzwoasi@e74e222d85c776527ab318852b887f5b7dffbca8 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/fmargall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deployment.yml@e74e222d85c776527ab318852b887f5b7dffbca8 -
Trigger Event:
push
-
Statement type: