Skip to content

Latest commit

 

History

History
executable file
·
68 lines (50 loc) · 2.07 KB

README.md

File metadata and controls

executable file
·
68 lines (50 loc) · 2.07 KB

Pyaravis

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.

Example

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()

Building the Library from Source

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 up

Packaging

After building the library from source, you can package the files for distribution:

  1. Install the required dependencies:

    uv sync
  2. Activate the virtual environment:

    source .venv/bin/active
  3. Build the package for distribution:

    hatchling build

This will create distribution packages under the dist/ folder

License

This project uses the following libraries, both licensed under the LGPL-2.1:

Please ensure compliance with the LGPL-2.1 license when using or distributing this project.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.