pypylon
The official python wrapper for the pylon Camera Software Suite
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.8%) to scientific vocabulary
Keywords
Repository
The official python wrapper for the pylon Camera Software Suite
Basic Info
- Host: GitHub
- Owner: basler
- License: bsd-3-clause
- Language: Python
- Default Branch: master
- Homepage: http://www.baslerweb.com
- Size: 22.6 MB
Statistics
- Stars: 655
- Watchers: 27
- Forks: 214
- Open Issues: 320
- Releases: 0
Topics
Metadata Files
README.md

The official python wrapper for the Basler pylon Camera Software Suite.
Background information about usage of pypylon, programming samples and jupyter notebooks can also be found at pypylon-samples.
Please Note: This project is offered with limited technical support by Basler AG. You are welcome to post any questions or issues on GitHub. For additional technical assistance, please reach out to our official Support team.
Getting Started
- Install pylon This is strongly recommended but not mandatory. See known issues for further details.
- Install pypylon:
pip3 install pypylonFor more installation options and the supported systems please read the Installation paragraph. - Look at samples/grab.py or use the following snippet:
```python from pypylon import pylon
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice()) camera.Open()
demonstrate some feature access
newwidth = camera.Width.Value - camera.Width.Inc if newwidth >= camera.Width.Min: camera.Width.Value = new_width
numberOfImagesToGrab = 100 camera.StartGrabbingMax(numberOfImagesToGrab)
while camera.IsGrabbing(): grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
# Access the image data.
print("SizeX: ", grabResult.Width)
print("SizeY: ", grabResult.Height)
img = grabResult.Array
print("Gray value of first pixel: ", img[0, 0])
grabResult.Release()
camera.Close() ```
Getting Started with pylon Data Processing
- pypylon additionally supports the pylon Data Processing API extension.
- The pylon Workbench allows you to create image processing designs using a graphical editor.
- Hint: The pylondataprocessing_tests can optionally be used as a source of information about the syntax of the API.
- Look at samples/dataprocessing_barcode.py or use the following snippet:
```python from pypylon import pylondataprocessing import os
resultCollector = pylondataprocessing.GenericOutputObserver() recipe = pylondataprocessing.Recipe() recipe.Load('dataprocessingbarcode.precipe') recipe.RegisterAllOutputsObserver(resultCollector, pylon.RegistrationModeAppend); recipe.Start()
for i in range(0, 100): if resultCollector.GetWaitObject().Wait(5000): result = resultCollector.RetrieveResult() # Print the barcodes variant = result["Barcodes"] if not variant.HasError(): # Print result data for barcodeIndex in range(0, variant.NumArrayValues): print(variant.GetArrayValue(barcodeIndex).ToString()) else: print("Error: " + variant.GetErrorDescription()) else: print("Result timeout") break
recipe.Unload() ```
Update your code to pypylon >= 3.0.0
The current pypylon implementation allows direct feature assignment:
python
cam.Gain = 42
This assignment style is deprecated with pypylon 3.0.0, as it prevents full typing support for pypylon.
The recommended assignment style is now:
python
cam.Gain.Value = 42
To identify the locations in your code that have to be updated, run with enabled warnings:
PYTHONWARNINGS=default python script.py
Installation
Prerequisites
- Installed pylon For the binary installation this is not mandatory but strongly recommended. See known issues for further details.
- Installed python with pip
- Installed CodeMeter Runtime when you want to use pylon vTools and the pylon Data Processing API extension on your platform.
pylon OS Versions and Features
Please note that the pylon Camera Software Suite may support different operating system versions and features than pypylon. For latest information on pylon refer to: https://www.baslerweb.com/en/software/pylon/ In addition, check the release notes of your pylon installation. For instance: * pylon Camera Software Suite 8.1.0 supports Windows 10/11 64 bit, Linux x8664 and Linux aarch64 with glibc version >= 2.31 or newer, macOS Sonoma or newer. * pylon vTools are supported on pylon 7.0.0 and newer. * pylon vTools are supported on pypylon 3.0 and newer only on Windows 10/11 64 bit, Linux x8664 and Linux aarch64. * For pylon vTools that require a license refer to: https://www.baslerweb.com/en/software/pylon-vtools/ * CXP-12: To use CXP with pypylon >= 4.0.0 you need to install the CXP GenTL producer and drivers using the pylon Camera Software Suite setup. * For accessing Basler 3D cameras, e.g. Basler blaze, installation of pylon Camera Software Suite 8.1.0 and the latest pylon Supplementary Package for blaze is required.
Binary Installation
The easiest way to get pypylon is to install a prebuild wheel. Binary releases for most architectures are available on pypi**. To install pypylon open your favourite terminal and run:
pip3 install pypylon
The following versions are available on pypi:
| | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | |----------------|-----|------|------|------|------| | Windows 64bit | x | x | x | x | x | | Linux x8664* | x | x | x | x | x | | Linux aarch64* | x | x | x | x | x | | macOS x8664** | x | x | x | x | x | | macOS arm64** | x | x | x | x | x |
Additional Notes on binary packages: * () The linux 64bit binaries are manylinux231 conformant. This is roughly equivalent to a minimum glibc version >= 2.31. :warning: You need at least pip 20.3 to install them. * (*) macOS binaries are built for macOS >= 14.0 (Sonoma)
Installation from Source
Building the pypylon bindings is supported and tested on Windows, Linux and macOS
You need a few more things to compile pypylon:
* An installation of pylon SDK for your platform
* A compiler for your system (Visual Studio on Windows, gcc on linux, xCode commandline tools on macOS)
* Python development files (e.g. sudo apt install python-dev on linux)
* swig 4.3
* For all 64bit platforms you can install the tool via pip install "swig==4.3"
To build pypylon from source:
console
git clone https://github.com/basler/pypylon.git
cd pypylon
pip install .
If pylon SDK is not installed in a default location you have to specify the location from the environment
* on Linux: export PYLON_ROOT=<installation directory of pylon SDK>
* on macOS: export PYLON_FRAMEWORK_LOCATION=<framework base folder that contains pylon.framework>
Development
Pull requests to pypylon are very welcome. To help you getting started with pypylon improvements, here are some hints:
Starting Development
console
python setup.py develop
This will "link" the local pypylon source directory into your python installation. It will not package the pylon libraries and always use the installed pylon.
After changing pypylon, execute python setup.py build and test...
Running Unit Tests
NOTE: The unit tests try to import
pypylon...., so they run against the installed version of pypylon.console pytest tests/....
Known Issues
- For USB 3.0 cameras to work on Linux, you need to install appropriate udev rules. The easiest way to get them is to install the official pylon package.
Owner
- Name: Basler
- Login: basler
- Kind: organization
- Email: oss@baslerweb.com
- Website: http://www.baslerweb.com
- Repositories: 12
- Profile: https://github.com/basler
GitHub Events
Total
- Create event: 11
- Release event: 3
- Issues event: 91
- Watch event: 77
- Delete event: 3
- Issue comment event: 211
- Push event: 62
- Pull request review comment event: 1
- Pull request event: 6
- Pull request review event: 4
- Fork event: 12
Last Year
- Create event: 11
- Release event: 3
- Issues event: 91
- Watch event: 77
- Delete event: 3
- Issue comment event: 211
- Push event: 62
- Pull request review comment event: 1
- Pull request event: 6
- Pull request review event: 4
- Fork event: 12
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Stefan Klug | s****g@b****m | 121 |
| Thies Moeller | t****r@b****m | 54 |
| Rocco Matano | r****o@b****m | 42 |
| Thies Möller | t****r@g****m | 6 |
| Rocco Matano | R****o@b****m | 4 |
| Habetdin | 1****n | 2 |
| Holger Klingspohr | h****r@b****m | 2 |
| Josh Veitch-Michaelis | j****b@g****m | 2 |
| Maximilian Köstler | M****r@b****m | 2 |
| Klug, Stefan | S****g@b****m | 2 |
| Franz | f****r@g****m | 1 |
| Thorben Dittmar | t****r@b****m | 1 |
| Farzad Ahmadinejad | f****w@g****m | 1 |
| ssnet@freenet.de | s****t@f****e | 1 |
| Jonas Karp | j****p@b****m | 1 |
| Andreas Gäer | a****r@b****m | 1 |
| Rennfanz, Björn | b****z@b****m | 1 |
| Wheest | W****t | 1 |
| nunoluis | 5****s | 1 |
| Genevieve Buckley | 3****y | 1 |
| Ryan Govostes | r****v | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 360
- Total pull requests: 10
- Average time to close issues: 7 months
- Average time to close pull requests: over 1 year
- Total issue authors: 275
- Total pull request authors: 5
- Average comments per issue: 3.7
- Average comments per pull request: 0.2
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 70
- Pull requests: 6
- Average time to close issues: 9 days
- Average time to close pull requests: 2 months
- Issue authors: 62
- Pull request authors: 3
- Average comments per issue: 1.26
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Wiktor010 (7)
- pourfard (5)
- shimens (4)
- TuanHAnhVN (4)
- tc360950 (4)
- ridvanozdemir (4)
- hlacikd (4)
- jokubas11 (4)
- Lucrezia-Cester (4)
- canliu0414 (3)
- kesaroid (3)
- Nemarott (3)
- mahiuchun (3)
- Septembit (3)
- ysraja2415 (3)
Pull Request Authors
- HighImp (4)
- ahrensburger (2)
- RealBrandonChen (2)
- gaeeronimo (1)
- asavpatel (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 61,766 last-month
- Total docker downloads: 124
- Total dependent packages: 9
- Total dependent repositories: 33
- Total versions: 43
- Total maintainers: 2
pypi.org: pypylon
The python wrapper for the Basler pylon Camera Software Suite.
- Homepage: https://github.com/basler/pypylon
- Documentation: https://pypylon.readthedocs.io/
- License: Other/Proprietary License
-
Latest release: 4.2.0
published 9 months ago
Rankings
Maintainers (2)
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/upload-artifact v2 composite
- geekyeggo/delete-artifact v1 composite
- softprops/action-gh-release v1 composite