Skip to main content

Official Python library for controlling Integrated Optics MatchBox2 laser modules via USB serial interface.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matchbox2py-0.1.6.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matchbox2py-0.1.6-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file matchbox2py-0.1.6.tar.gz.

File metadata

  • Download URL: matchbox2py-0.1.6.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for matchbox2py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 eb54c9540ff839049b3d219c9aeae6d4232fe48a6ad09cf6c93a63cca7484e16
MD5 a89ba75b9f44d69038a714dab87752da
BLAKE2b-256 b3c77aae390f9c7e9638ea38822f89b77d9eef8035cf635c9bbd9cb383d02d59

See more details on using hashes here.

File details

Details for the file matchbox2py-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: matchbox2py-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for matchbox2py-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 89f9f10a3abd5cadfcb340c528303237c7fcc21ab6d5113e886fce060368a317
MD5 f938c798220245678caa3deefc808b20
BLAKE2b-256 66b09ab94a5c2612c868aa85be65df260c37a09f7219a9b2408f05618c40b997

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page