Skip to main content

A flexible Python library for reading and plotting data from laboratory measurement equipment

Project description

LabDataPlot

A flexible Python library for reading and plotting data from laboratory measurement equipment

PyPI version Python versions License


LabDataPlot simplifies the process of loading, analyzing, and visualizing data exported from laboratory instruments. Stop wrestling with different file formats and focus on your data.

Features

  • Automatic format detection - Just pass the file, the library figures out the format
  • Multiple equipment support - 10+ instruments from major manufacturers
  • Simple plotting API - Clean wrapper around matplotlib for quick visualizations
  • Direct data access - Full pandas DataFrame access for custom analysis
  • Time-aware - Automatic detection and parsing of timestamp columns
  • Metadata extraction - Access acquisition date, channel info, units, and more

Supported Equipment

Data Acquisition / Dataloggers

Equipment Parser Name File Type
Keysight 34970A/34972A keysight Excel (.xlsx)
Dewesoft Datalogger dewesoft Excel (.xlsx)
Fluke Hydra 2680/2686 fluke CSV, Excel
Hioki LR8400/LR8401/MR8875 hioki CSV, Excel

Oscilloscopes

Equipment Parser Name File Type
Tektronix TDS/MSO/DPO/MDO tektronix CSV
Rigol DS/MSO series rigol CSV
Yokogawa DL/SL series yokogawa CSV, Excel

Power Analyzers & Source Meters

Equipment Parser Name File Type
Yokogawa WT series yokogawa CSV, Excel
Keithley 2400/2450 SourceMeter keithley CSV, Excel
Keithley DMM6500/DAQ6510 keithley CSV, Excel

Generic

Format Parser Name Description
CSV csv Generic CSV with auto-detection

Installation

pip install labdataplot

Requirements

  • Python 3.10+
  • pandas >= 2.0.0
  • matplotlib >= 3.7.0
  • openpyxl >= 3.1.0

Quick Start

Basic Usage

from labdataplot import DataLoader, Plotter

# Load data (format auto-detected)
loader = DataLoader('measurement.xlsx')

# View file information
print(loader.info)
# DataInfo(
#   equipment='Keysight 34970A',
#   channels=60,
#   time_column='Time',
#   acquisition_date='2025-11-25 17:37:50'
# )

# Create plots
plotter = Plotter(loader)
plotter.plot(['101 (VDC)', '102 (VDC)', '103 (VDC)'])
plotter.show()

Loading Data

from labdataplot import DataLoader, list_parsers

# See all available parsers
print(list_parsers())
# ['dewesoft', 'keysight', 'fluke', 'hioki', 'tektronix', 'rigol', 'yokogawa', 'keithley', 'csv']

# Auto-detect format
loader = DataLoader('data.xlsx')

# Or specify format explicitly
loader = DataLoader('data.csv', format='tektronix')

# Access data
df = loader.data              # Full pandas DataFrame
time = loader.time            # Time column (if available)
cols = loader.columns         # List of data columns
channel = loader['CH1']       # Direct column access

# Find channels by pattern
voltage_channels = loader.get_channel(r'VDC')  # All channels with "VDC"

Plotting

from labdataplot import DataLoader, Plotter

loader = DataLoader('oscilloscope_capture.csv')
plotter = Plotter(loader)

# Single channel
plotter.plot('CH1', title='Channel 1', ylabel='Voltage (V)')

# Multiple channels
plotter.plot(['CH1', 'CH2', 'CH3', 'CH4'])

# Subplots - one per channel
plotter.subplots(['CH1', 'CH2', 'CH3', 'CH4'], rows=2, cols=2)

# Quick view of first N channels
plotter.quick(10)

# Heatmap visualization
plotter.heatmap(title='All Channels Overview')

# Save figure
plotter.save('output.png', dpi=300)

plotter.show()

Comparing Multiple Files

loader1 = DataLoader('before_test.csv')
loader2 = DataLoader('after_test.csv')

plotter = Plotter(loader1)
plotter.compare(
    loader2,
    column='CH1',
    labels=['Before', 'After'],
    title='Test Comparison'
)
plotter.show()

Examples

Simple Line Plot

plotter.plot(
    ['CH1', 'CH2'],
    title='Oscilloscope Capture',
    ylabel='Voltage (V)',
    xlabel='Time (s)'
)

Simple Plot

Subplots

plotter.subplots(
    ['101 (VDC)', '201 (VDC)', '301 (VDC)'],
    rows=3,
    title='One Channel per Slot'
)

Subplots

Heatmap

plotter.heatmap(
    columns=loader.columns[:15],
    title='First 15 Channels'
)

Heatmap

Adding Support for New Equipment

LabDataPlot is designed to be easily extensible. To add support for new equipment:

  1. Create a new parser in labdataplot/parsers/
  2. Inherit from BaseParser
  3. Implement detect() and parse() methods
  4. Register in parsers/__init__.py
from labdataplot.parsers.base import BaseParser, DataInfo
import pandas as pd

class MyEquipmentParser(BaseParser):
    name = "my_equipment"
    description = "Parser for My Equipment"

    def detect(self, filepath: str) -> bool:
        # Return True if file matches this format
        ...

    def parse(self, filepath: str) -> tuple[pd.DataFrame, DataInfo]:
        # Read and return (DataFrame, DataInfo)
        ...

See the documentation for detailed instructions.

API Reference

DataLoader

Property/Method Description
data Returns pandas DataFrame with all data
info Returns DataInfo with metadata
columns List of data column names
time Time column as Series (if available)
head(n) First n rows
describe() Statistical summary
get_channel(pattern) Find columns matching regex pattern

Plotter

Method Description
plot(columns, ...) Line plot of one or more columns
subplots(columns, rows, cols, ...) Multiple subplots
compare(*loaders, column, ...) Compare same column across files
heatmap(columns, ...) Heatmap visualization
quick(n) Quick view of first n columns
save(filename, dpi) Save current figure
show() Display all plots

Documentation

Full documentation is available in the docs folder:

Contributing

Contributions are welcome! Whether it's:

  • Adding support for new equipment
  • Bug fixes
  • Documentation improvements
  • Feature requests

Please feel free to open an issue or submit a pull request.

Development Setup

# Clone the repository
git clone https://github.com/lgili/LabDataPlot.git
cd LabDataPlot

# Install in development mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black labdataplot
ruff check labdataplot

Roadmap

  • Keysight 34970A datalogger support
  • Dewesoft datalogger support
  • Tektronix oscilloscope support
  • Rigol oscilloscope support
  • Yokogawa instruments support
  • Keithley SourceMeter support
  • Fluke datalogger support
  • Hioki datalogger support
  • Generic CSV support
  • Interactive plots with Plotly
  • Data export functionality
  • Report generation
  • CLI interface
  • NI DAQ support
  • LeCroy oscilloscope support
  • Rohde & Schwarz support

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Built with pandas and matplotlib
  • Inspired by the need to quickly visualize test data from various lab equipment

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

labdataplot-0.2.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

labdataplot-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file labdataplot-0.2.1.tar.gz.

File metadata

  • Download URL: labdataplot-0.2.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for labdataplot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 358c43aef8d884a92cae9977b9344f6aa6f5fcc19d963aaa915c995c9723508b
MD5 8e3de53ae96ef6cc6238725839e6aa36
BLAKE2b-256 56d7cc2ac87d24456c9971fe13951e97598b5bd08fafdd70a0b2ef203ee711c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for labdataplot-0.2.1.tar.gz:

Publisher: publish.yml on lgili/LabDataPlot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file labdataplot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: labdataplot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for labdataplot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb5afc8d82be493f1a6597bfe9a2adc49172e2cfd86855fbe1f1ea8cb7fa99e0
MD5 e9760b03276ef906791c4836bd764f92
BLAKE2b-256 b7bf60f781bc9addcc7054fd51d9cd65fb66513fcd944dc453bf54d11d5b4c48

See more details on using hashes here.

Provenance

The following attestation bundles were made for labdataplot-0.2.1-py3-none-any.whl:

Publisher: publish.yml on lgili/LabDataPlot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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