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()
Metadata
Release files for NESP-Lib 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nesp_lib-2.0.0.tar.gz | 9.9 kB | Without provenance | Details for nesp_lib-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nesp_lib-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for nesp_lib-2.0.0-py3-none-any.whl |
Total release size: 21.4 kB
Release files / nesp_lib-2.0.0.tar.gz
| Download URL | nesp_lib-2.0.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d4fb42024c4469876d0f3a479b87ceec30c4f4af62e76c74367f7cf5c5ed14d
|
|
BLAKE2b-256 checksum How to use checksums |
54b80cad16ac3fdd09758266fc2e192a69b72eb490fd6d6035b3972500cb65be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Release files / nesp_lib-2.0.0-py3-none-any.whl
| Download URL | nesp_lib-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d88e6a5e243b5ad0d89dcba51f2f9f4f7dc10ff913f4947b58a062465a2ebac
|
|
BLAKE2b-256 checksum How to use checksums |
a7a89602566269722b30d25b86942fe76dffcb4e1c5500a102332949f4c2606f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Security for NESP-Lib 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.