Skip to main content

Integrated Optics

Official MatchBox2 Python Library


🧩 Overview

MatchBox2 Python Library provides a simple and structured interface for controlling Integrated Optics MatchBox2 laser modules over USB serial communication.

It offers:

  • High-level API for laser operations
  • Structured models for laser info, settings, and readings
  • Built-in command parsing for MatchBox2 and Combiner lasers
  • Support for automatic device discovery

⚙️ Installation

Install the library directly from GitHub:

python -m pip install git+https://github.com/Integrated-optics/matchbox2py.git

or from a local clone:

git clone https://github.com/Integrated-optics/matchbox2py.git
cd matchbox2py
python -m pip install .

🚀 Quickstart

MatchBox2 Laser Example

from matchbox2 import MatchBox2Laser

available_lasers = MatchBox2Laser().get_available_lasers()

if available_lasers:
    laser = MatchBox2Laser()
    laser.connect(available_lasers[0].portName)
    laser.set_laser_on()
    readings = laser.get_laser_readings()
    print(readings)
    laser.set_laser_off()
    laser.disconnect()
else:
    print("No lasers detected.")

MatchBox2 Laser Combiner Example

from matchbox2 import MatchBox2CombinerLaser

available_lasers = MatchBox2CombinerLaser().get_available_lasers()

if available_lasers:
    laser = MatchBox2CombinerLaser()
    laser.connect(available_lasers[0].portName)
    laser.set_enable_power()
    readings = laser.get_laser_readings()
    print(readings)

    # Enable / disable diodes
    for i in range(1, 5):
        laser.set_diode_enable(i)
    for i in range(1, 5):
        laser.set_diode_disable(i)

    laser.set_disable_power()
    laser.disconnect()
else:
    print("No lasers detected.")

🪪 License

This project is licensed under the MIT License — see the LICENSE file for details.


🌐 Links


© 2025 Integrated Optics

Metadata

Release files for matchbox2py 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matchbox2py 0.1.6
File Size Uploaded
matchbox2py-0.1.6.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for matchbox2py 0.1.6
File Interpreter ABI Platform
matchbox2py-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / matchbox2py-0.1.6.tar.gz

Download URL matchbox2py-0.1.6.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eb54c9540ff839049b3d219c9aeae6d4232fe48a6ad09cf6c93a63cca7484e16
BLAKE2b-256 checksum
How to use checksums
b3c77aae390f9c7e9638ea38822f89b77d9eef8035cf635c9bbd9cb383d02d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / matchbox2py-0.1.6-py3-none-any.whl

Download URL matchbox2py-0.1.6-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89f9f10a3abd5cadfcb340c528303237c7fcc21ab6d5113e886fce060368a317
BLAKE2b-256 checksum
How to use checksums
66b09ab94a5c2612c868aa85be65df260c37a09f7219a9b2408f05618c40b997
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page