Skip to main content

New Era Syringe Pump Library for Python

Project description

NESP-Lib – New Era Syringe Pump Library for Python

This project aims to offer a clean high-level interface to the New Era syringe pumps by New Era Pump Systems.

These pumps are also distributed under different names, like Aladdin by World Precision Instruments (WPI) and LA by Landgraf Laborsysteme.

Features

  • Object-oriented design
  • Documented public elements via type hints and docstrings
  • Signaling errors via exceptions
  • Blocking and non-blocking running
  • Sending heartbeat messages automatically

Installing

pip install NESP-Lib

Importing

import nesp_lib

Examples

Opening and Closing a Port

Manual Closing

from nesp_lib import Port

# Constructs and opens the port to which the pump is connected.
port = Port('COM1')

# Do something here while the port is open.
...

# Closes the port.
port.close()

Automatic Closing

from nesp_lib import Port

# Constructs, opens and automatically closes the port to which the pump is connected.
with Port('COM1') as port:
    # Do something here while the port is open.
    ...

Configuring a Pump

from nesp_lib import Pump, PumpingDirection

# Constructs the pump connected to the port.
pump = Pump(port)

# Sets the syringe diameter of the pump in units of millimeters.
pump.syringe_diameter_mm = 30.0

# Sets the pumping direction of the pump.
pump.pumping_direction = PumpingDirection.INFUSE

# Sets the pumping volume of the pump in units of milliliters.
pump.pumping_volume_ml = 1.0

# Sets the pumping rate of the pump in units of milliliters per minute.
pump.pumping_rate_ml_per_min = 20.0

Identifying a Pump

# Prints the model number of the pump (e.g. "1000" for NE-1000).
print(pump.model_number)

# Prints the firmware version of the pump (e.g. "(3, 928)" for 3.928).
print(pump.firmware_version)

Running a Pump

Blocking

Blocking running waits while the pump is running.

# Runs the pump considering the direction, volume, and rate set.
pump.run()

Non-blocking

Non-blocking running returns immediately after starting the running.

# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)

# Waits while the pump is running.
pump.wait_while_running()

# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)

# Waits while the pump is running.
while pump.running:
    # Do something here while the pump is running.
    ...

# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)

# Do something here while the pump is running.
...

# Stops the pump.
pump.stop()

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

nesp_lib-2.0.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

nesp_lib-2.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file nesp_lib-2.0.0.tar.gz.

File metadata

  • Download URL: nesp_lib-2.0.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for nesp_lib-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9d4fb42024c4469876d0f3a479b87ceec30c4f4af62e76c74367f7cf5c5ed14d
MD5 a5db46488e47ad8cdbbda712b3730a58
BLAKE2b-256 54b80cad16ac3fdd09758266fc2e192a69b72eb490fd6d6035b3972500cb65be

See more details on using hashes here.

File details

Details for the file nesp_lib-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: nesp_lib-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for nesp_lib-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d88e6a5e243b5ad0d89dcba51f2f9f4f7dc10ff913f4947b58a062465a2ebac
MD5 81d3e9095c72943b05aacd0911811103
BLAKE2b-256 a7a89602566269722b30d25b86942fe76dffcb4e1c5500a102332949f4c2606f

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