Welcome to Lab Utils!¶
lab_utils
is a collection of useful modules for Python development in the context of scientific laboratory
work. It was created to standardize common tasks and features used by many different apps and users. The package aims to
provide simple, efficient and robust protocols in the following areas:
PostgreSQL Database Interface. The
database
module provides a simple interface to manage connections to a PostgreSQL database. It uses the packagepsycopg2
(a Python wrapper of the C library libpq) to provide simple database functionality.Daemon-like TCP Server. The
socket_comm
module provides a daemon-like TCP server base class. Thelab_utils.socket_comm.Server
is supposed to start and run indefinitely in the background, while listening for incoming communications over a TCP port. When a message is received, a string parser calls the appropriate method. Users should develop their own child class inheriting fromlab_utils.socket_comm.Server
and implementing the necessary methods for their particular needs.The module also provides a simple
lab_utils.socket_comm.Client
to send messages to a runninglab_utils.socket_comm.Server
and receive the reply.
If this is your first time using lab_utils
, have a look at our Readme for a more
detailed summary and installation instructions. If you’re already familiar with this package, or you want to dive
straight in, you can jump to the API reference. There are also some examples which
demonstrate specific applications of the modules.