Skip to main content

A Python library for reading and writing STDF4 files

Project description


pystdf4

An object-oriented Python library for parsing and generating STDF (Standard Test Data Format) files used in semiconductor testing and manufacturing.


๐Ÿงฉ Overview

pystdf4 provides a modern, object-oriented interface for working with STDF v4 files โ€” the industry-standard binary data format for semiconductor test results. It supports both reading and writing of STDF files, with a clean Python API that abstracts low-level binary details into high-level Pythonic objects.


๐Ÿ“˜ STDF4 Data Type Codes

The Standard Test Data Format (STDF) specification defines compact type codes to describe how values are stored and interpreted within records. Each type code corresponds to a C data type, defining the byte layout and valid range of values.

Code Description C Type Specifier Notes
C*1 Fixed-length character string (1 characters) char[1] Left-justified; pad with spaces if shorter than 12 characters.
C*n Variable-length character string char[] First byte stores the length (0โ€“255).
C*f Variable-length string with external length char[] Length determined by another record field.
U*1 1-byte unsigned integer unsigned char Range: 0โ€“255
U*2 2-byte unsigned integer unsigned short Range: 0โ€“65,535
U*4 4-byte unsigned integer unsigned long Range: 0โ€“4,294,967,295
I*1 1-byte signed integer char Range: โ€“128 to 127
I*2 2-byte signed integer short Range: โ€“32,768 to 32,767
I*4 4-byte signed integer long Range: โ€“2,147,483,648 to 2,147,483,647
R*4 4-byte floating-point number (IEEE 754) float Standard single-precision float
R*8 8-byte floating-point number (IEEE 754) double Standard double-precision float
B*6 Fixed-length binary field (6 bytes) char[6] Raw binary data
V*n Variable-type field โ€” First byte = type code, followed by up to 255 bytes of data
B*n Variable-length binary field char[] First byte = byte count (0โ€“255); data starts at LSB of second byte
D*n Variable-length bit field char[] First two bytes = bit count (0โ€“65,535); unused bits in last byte = 0
N*1 Nibble (4-bit) data char Stores unsigned integers in 4-bit units; high nibble zeroed if odd count
kxTYPE Array of specified data type TYPE[] Length k determined by another record field (e.g. kxU*2)

๐Ÿงฑ PyStdf4 Data Model

The PyStdf4 type system provides a structured, extensible way to represent STDF data elements as Python classes. Each class encapsulates type conversion, byte parsing, and STDF serialization.

Field (ABC)
โ”œโ”€โ”€ ScalarField[_PyT]
โ”‚   โ”œโ”€โ”€ U_1, U_2, U_4       # unsigned int
โ”‚   โ”œโ”€โ”€ I_1, I_2, I_4       # signed int
โ”‚   โ”œโ”€โ”€ R_4, R_8            # float
โ”‚   โ”œโ”€โ”€ C_1                 # char โ†’ bytes
โ”‚   โ””โ”€โ”€ B_1                 # raw bytes
โ””โ”€โ”€ SequenceField[_PyT] (ABC)
    โ”œโ”€โ”€ FixLenField[_PyT]
    โ”œโ”€โ”€ VarLenField[_PyT]
    โ”‚   โ”œโ”€โ”€ C_n (str โ†’ bytes)
    โ”‚   โ””โ”€โ”€ B_n (bytes)
    โ””โ”€โ”€ KxLenField
        โ”œโ”€โ”€ KxU_1
        โ”œโ”€โ”€ KxU_2
        โ”œโ”€โ”€ KxC_n
        โ””โ”€โ”€ KxR_4

These classes standardize how data flows between Python, C-style internal representations, and STDF binary data.


๐Ÿ”„ Data Flow

The transformation pipeline for STDF data in pystdf4 can be summarized as follows:

py_value (Python type)
   โ‡„ [build_py / parse_py]
internal_bytes (C-style binary data)
   โ‡„ [build_stdf / parse_stdf]
stdf_value (STDF field data)

This design ensures each data element can:

  • be parsed from STDF binary files,
  • be converted into native Python types for analysis or manipulation,
  • and be re-serialized back into valid STDF format.

๐Ÿ“‹ STDF v4 Record Types Implementation Status

Record Type Name REC_TYP REC_SUB Status Notes
FAR File Attributes Record 0 10 โœ”๏ธ Complete Required as first record
ATR Audit Trail Record 0 20 โœ”๏ธ Complete Tracks file modifications
MIR Master Information Record 1 10 โœ”๏ธ Complete Lot-level information
MRR Master Results Record 1 20 โœ”๏ธ Complete End of lot summary
PCR Part Count Record 1 30 โœ”๏ธ Complete Part statistics
HBR Hardware Bin Record 1 40 โœ”๏ธ Complete Physical binning counts
SBR Software Bin Record 1 50 โœ”๏ธ Complete Logical binning counts
PMR Pin Map Record 1 60 โœ”๏ธ Complete Pin/channel mapping
PGR Pin Group Record 1 62 โŒ Incomplete Pin grouping
PLR Pin List Record 1 63 โŒ Incomplete Pin group display properties
RDR Retest Data Record 1 70 โŒ Incomplete Retest information
SDR Site Description Record 1 80 โœ”๏ธ Complete Test site configuration
WIR Wafer Information Record 2 10 โœ”๏ธ Complete Wafer start marker
WRR Wafer Results Record 2 20 โœ”๏ธ Complete Wafer completion summary
WCR Wafer Configuration Record 2 30 โœ”๏ธ Complete Wafer dimensions/orientation
PIR Part Information Record 5 10 โœ”๏ธ Complete Part start marker
PRR Part Results Record 5 20 โœ”๏ธ Complete Part completion results
TSR Test Synopsis Record 10 30 โœ”๏ธ Complete Test execution statistics
PTR Parametric Test Record 15 10 โœ”๏ธ Complete Single parametric test result
MPR Multiple-Result Parametric Record 15 15 โŒ Incomplete Multiple parametric test results
FTR Functional Test Record 15 20 โŒ Incomplete Functional test results
BPS Begin Program Section Record 20 10 โœ”๏ธ Complete Program section start marker
EPS End Program Section Record 20 20 โœ”๏ธ Complete Program section end marker
GDR Generic Data Record 50 10 โŒ Incomplete User-defined data
DTR Datalog Text Record 50 30 โŒ Incomplete Datalog comments

๐Ÿงช Example Use Cases (Coming Soon)

  • Parse STDF records into structured Python objects
  • Convert STDF to human-readable CSV or JSON
  • Build new STDF records programmatically
  • Validate field encoding/decoding across STDF revisions

๐Ÿ“œ License

MIT License ยฉ 2025 Developed for efficient and reliable STDF data manipulation in modern semiconductor workflows.


Would you like me to extend it with an โ€œInstallation and Quick Startโ€ section (e.g., pip install pystdf4 and a short usage example)? That would make it more complete for public release on GitHub or PyPI.

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

pystdf4-0.1.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

pystdf4-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file pystdf4-0.1.0.tar.gz.

File metadata

  • Download URL: pystdf4-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pystdf4-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1076b8316ffa9e071848753cf9a187db2dea373bc5dcde1ce1d4bcdb7f9c5493
MD5 056b34e4343a5d54c84278e40ded9022
BLAKE2b-256 0662115bb171281f6e19b27ff9b9bb3011f73072549e2cfe670fe06e80e73feb

See more details on using hashes here.

File details

Details for the file pystdf4-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pystdf4-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pystdf4-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54173cac55774425c2b0e914269b8d06ca4c5e3da295b9b5c588f38e328c8b4e
MD5 86b0f461d029aeea03db227698add0d1
BLAKE2b-256 e2fe15bb172a3bf82ce70622caf2fe21ffd5f569319a9dc3b5e627ac68fbdd82

See more details on using hashes here.

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