#semiconductor #file-parser #dataframe #python-bindings #stdf #ate

bin+lib stupidf

Parsing of STDF file format to DataFrame with Python bindings

3 releases (breaking)

Uses new Rust 2024

new 0.3.0 Mar 20, 2025
0.2.0 Mar 17, 2025
0.1.0 Mar 17, 2025

#841 in Parser implementations

Download history 287/week @ 2025-03-16

287 downloads per month

MIT license

99KB
2.5K SLoC

stupidf

stupidf is a library for limited parsing of STDF files. The STDF structure can be used directly in rust, or alternatively sent out to Python using the parse_stdf function.

STDF is the Standard Test Data Format and is commonly used for high-volume test of semiconductors in Automated Test Equipment (ATE) systems.

The purpose of the library is to quickly and efficiently parse STDF files (which are a fairly unfriendly binary linked list-based format) into more friendly polars DataFrame format.

Not all record types are implemented because they're not relevant for my purposes. Implementing new records is straight-forward, following the others.

Example

In rust

use stupidf::data::STDF;
use polars::prelude::*;

let verbose = false;
if let Ok(stdf) = STDF::from_fname(&fname, verbose) {
    let df: DataFrame = (&stdf.test_data).into();
    let df_fmti: DataFrame = (&stdf.test_data.test_information).into();
    println!("{df:#?}");
    println!("{df_fmti}");
    }

Also contains Python bindings to this functionality, e.g.

   import stupidf as sf
   stdf = sf.parse_stdf("my_stdf.stdf")
   stdf['df']

Installation

To install the rust CLI binary:

cargo install stupidf

To add the stupidf library to a rust project, add to the Cargol.toml:

[dependencies]
<... snip ...>
stupidf = "0.1.0"

or execute from the command line in your rust project

cargo add stupidf

To install the Python bindings and pre-built wheel (linux and win currently):

pip install stupidf

Building from source

The rust library can be compiled simply with

cargo build

The Python bindings can be made using maturin. Activate the desired virtualenv, then install maturin and use it to build the bindings

pip install maturin
maturin develop

Dependencies

~32–60MB
~1M SLoC