Niels van Eck

← Projects

2026 · Python · live

PIR-ELN

An electronic lab notebook for polyurethane and PIR foam R&D, quality control and production, written in pure Python.

PIR-ELN is an electronic lab notebook for a lab that develops and tests polyurethane and PIR foams, for example for insulation and sandwich panels. It is one web application for the whole lab: R&D, quality control and production. It runs on its own server or in Docker, with all data in one folder. I built it as a side project.

Formulations are entered in parts by weight, and the app calculates OH value, isocyanate index, the amount of isocyanate needed, blowing from water and cost as you type. Experiments collect results from a configurable property catalogue, and a frozen experiment is locked together with its attachments. Around it sit design of experiments, raw material stock with safety data, QC week sheets with control charts, projects with Kanban and Gantt views, and training courses on polyurethane chemistry.

What was interesting to solve

  • No compiled dependencies. The first host could not reliably build numpy or scipy, so all statistics are plain Python: Plackett-Burman and other designs, multiple regression, ANOVA and spectrum matching. Word reports come from my own small .docx writer built on zipfile.
  • Instrument imports. Data from mechanical test machines, foam rise-curve equipment, FT-IR spectrometers, a pycnometer and production-line process logs is imported from their export files instead of being retyped.
  • Selling it in parts. The app can be licensed as a base plus six optional modules. A signed licence file (Ed25519, also in pure Python) is checked in middleware per URL prefix, so a switched-off module is closed at the API as well as in the menu.
  • Updating itself from Git. An admin clicks "Update" and a script on the host pulls the latest commit, takes a snapshot, builds the image, runs the test suite inside it, and switches over only when a health check passes, with a rollback path if it does not.

Stack

Python 3.11, FastAPI, SQLAlchemy, SQLite, plain JavaScript with no build step, Chart.js, pytest, Docker, Caddy. Installable as a PWA.