basler/pypylon

The official Python language binding for the Basler pylon C++ APIs

What it solves

pypylon gives Python developers a direct way to work with Basler industrial machine vision cameras. Without it, you would have to write C++ code to control the camera and capture images. It also exposes the pylon Data Processing API, so you can run image processing pipelines (like barcode detection) directly from Python.

How it works

pypylon wraps the Basler pylon C++ APIs using the SWIG binding generator. You install the pylon SDK (or rely on prebuilt wheels that bundle the necessary libraries) and import the pypylon module. The library provides an InstantCamera class that lets you find, open, configure, and grab images from cameras. A parameter API gives typed access to camera settings like gain, exposure, and pixel format. The Data Processing API loads recipe files created in the pylon Workbench and streams results back to Python observers.

Who it's for

Developers and engineers building Python applications that need to control Basler cameras for machine vision, quality inspection, research, or automation. It is also useful for teams that want to prototype image processing workflows using the pylon Workbench and then run them in Python.

Highlights

  • Official Python language binding maintained by Basler, the camera manufacturer.
  • Supports image acquisition from all Basler machine vision cameras (USB, GigE, CXP, 3D).
  • Includes the pylon Data Processing API for running image processing recipes (e.g., barcode reading) in Python.
  • Modern parameter API with convenience methods like SetToMaximum() and GetValueOrDefault(), plus context manager support for clean camera setup/teardown.
  • Installable via pip install pypylon with prebuilt wheels for Windows, Linux, and macOS (x86_64 and arm64).
  • Open source with sample code, a programmer's guide, and an AGENTS.md file for AI-assisted development.

Related

  • Project
  • Project
  • Project
  • Project
  • Project