Enhanced support for Python

Hi everyone,

I have been experimenting with Aravis lately, and I have to say I am really impressed with the project. I have been using it with Python and it works like a charm for my industrial projects.

That said, I have found the learning curve to be quite steep, mainly due to the lack of documentation and instructions for setting up the library in Python. Additionally, when working with the library, there aren’t any bindings to indicate which methods are available, what parameters they expect, or what they return.

With that in mind, I’d like to propose a couple of improvements on the Python side of the project:

  1. Publishing the Python library to standard repositories like PyPI, so Aravis can be installed more easily with a simple pip install.
  2. Providing self-explanatory bindings to make the library more accessible to Python developers, which could help attract more users and expand the community.

As an experienced Python developer, I’d be happy to help achieve these goals and contribute to improving the project if needed. I’m really looking forward to seeing how we can make Aravis even better!

Hi,

Thanks for the kind words.

Any contribution that would improve the python bindings or enable the distribution vi pip is welcome.

There is no python specific documentation. As the bindings are auto generated, it should be easy to translate a C API documentation to the python equivalent. There is the possibility to generate a python version of the API documentation: https://developer.gimp.org/resource/api/#manual-g-ir-doc-generation.

Emmanuel.

Hello Emmanuel,

Thank you for your response.

I have been working on this issue and have created a GitHub repository called pyaravis, which aims to automate the generation and publishing of Python bindings for the Aravis Library.

In this repository, you will find a docker-compose.yml configuration that:

  1. Builds the Aravis C Library.
  2. Automatically generates the pyaravis files, providing a Pythonic integration of the library. This allows developers to use the fully stubbed library with a simple from pyaravis import Aravis.

After that, you can package the pyaravis library and generate the necessary distribution files (wheels) for PyPI using hatchling build.

You may notice that the publishing aspect is not yet addressed. This is the part I would like to discuss with the project owners to make the process as official as possible and integrate it into the Aravis ecosystem. We should consider PyPI repository ownership, package naming, and other relevant details.

From my perspective, this repository would be an ideal addition to the AravisProject. It could be fully automated via a GitHub Action, triggered after each release of the Aravis Library. This way, we would have a low-maintenance, up-to-date Python package published.

If this is of interest to you and fits your priorities, I would greatly appreciate your feedback on the project, particularly regarding the build process, as I may be missing certain flags or configurations. I am fully open to suggestions and committed to making this tool as accessible as possible.

Please note that, for now, I have focused on Linux integration. The .so and .typelib files are bundled into the distribution, ensuring a smooth experience for end users, who will only need to install the library’s dependencies on their system.

Looking forward to your thoughts!

Best regards,
Ignasi