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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1076b8316ffa9e071848753cf9a187db2dea373bc5dcde1ce1d4bcdb7f9c5493
|
|
| MD5 |
056b34e4343a5d54c84278e40ded9022
|
|
| BLAKE2b-256 |
0662115bb171281f6e19b27ff9b9bb3011f73072549e2cfe670fe06e80e73feb
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54173cac55774425c2b0e914269b8d06ca4c5e3da295b9b5c588f38e328c8b4e
|
|
| MD5 |
86b0f461d029aeea03db227698add0d1
|
|
| BLAKE2b-256 |
e2fe15bb172a3bf82ce70622caf2fe21ffd5f569319a9dc3b5e627ac68fbdd82
|