Pyaravis is a project aimed at automating the generation and publishing of Python bindings for the Aravis Library, a powerful tool for working with GenICam-compatible cameras. This repository provides a streamlined solution using Docker to handle dependencies and build the Aravis library, along with Python stubs for improved type checking.
After installing the library, you can use it as follows:
from pyaravis import Aravis
# Get camera
camera = Aravis.Camera.new()
payload = camera.get_payload()
stream = camera.create_stream(None, None)
# Allocate Buffers
for i in range(0, 10):
stream.push_buffer(Aravis.Buffer.new_allocate(payload))
# Start acquisition
camera.start_acquisition()
for i in range(0, 20):
image = stream.pop_buffer()
print(image)
if image:
stream.push_buffer(image)
# Stop acquisition
camera.stop_acquisition()Running the Docker Compose configuration will generate all the necessary files in the pyaravis/ directory, enabling seamless and Pythonic usage of the library:
docker compose upAfter building the library from source, you can package the files for distribution:
-
Install the required dependencies:
uv sync
-
Activate the virtual environment:
source .venv/bin/active -
Build the package for distribution:
hatchling build
This will create distribution packages under the dist/ folder
This project uses the following libraries, both licensed under the LGPL-2.1:
- Aravis Library: The core library for GenICam-compatible camera control.
- pygobject-stubs: Provides type stubs for PyGObject.
Please ensure compliance with the LGPL-2.1 license when using or distributing this project.
Contributions are welcome! Please open an issue or submit a pull request.