Skip to main content

Control Leica microscopes with python

Project description


build-badge pypi-version wheel Documentation Status


Control Leica microscopes with python


  • The latest version of leicacam requires Python 3.5+
  • If you need to keep using Python 2.7, pin your version of leicacam to 0.3.0.

Install using pip:

pip3 install leicacam


Communicate with microscope

from leicacam import CAM

cam = CAM()   # initiate and connect, default localhost:8895

# some commands are created as short hands
# start matrix scan
response = cam.start_scan()

# but you could also create your own command with a list of tuples
command = [('cmd', 'enableall'),
           ('value', 'true')]
response = cam.send(command)

# or even send it as a bytes string (note the b)
command = b'/cmd:enableall /value:true'
response = cam.send(command)


See available commands in the API reference:


Install dependencies and link development version of leicacam to pip:

pip install -r requirements_dev.txt

Code formatting

We use black code formatter to automatically format the code. This requires Python 3.6 for development.

black ./



Build documentation locally

To build the documentation:

pip install -r docs/requirements.txt
make docs

Project details

Download files

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

Files for leicacam, version 0.4.2
Filename, size File type Python version Upload date Hashes
Filename, size leicacam-0.4.2-py3-none-any.whl (8.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size leicacam-0.4.2.tar.gz (11.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page