A pure-python parser for Cadence's PSF format.
Project description
psf-parser
psf-parser is a lightweight, dependency-free Python parser for Cadence's proprietary PSF (Parameter Storage Format) files.
It supports both the ASCII (psfascii) and binary (psfbin) formats.
Note: While Spectre uses psfbin as the default output format for most simulations, transient simulations typically use the psfxl format, which this parser does not support. To avoid issues, set the output format explicitly to psfbin.
Installation
Install psf-parser directly via pip:
pip install psf-parser
Usage
The psf-parser package provides a simple API for parsing and accessing PSF file contents.
It automatically detects the file format (ASCII or binary), but you can also specify it manually.
from psf_parser import PsfFile
psf = PsfFile("path/to/psf")
print(psf.header)
print(psf.sweeps)
print(psf.traces)
print(psf.values)
If you prefer lower-level access to the raw registry data, you can work directly with the parser classes:
from psf_parser import PsfParser
parser = PsfParser("path/to/ascii/psf", format="ascii").parse()
print(parser.header)
print(parser.registry.types)
Notes:
PsfParseracts as a factory and dispatches to the correct format-specific parser.PsfAsciiParserandPsfBinParserhandle the ASCII and binary formats respectively (for internal or advanced usage).
License
This project is licensed under the MIT License.
Acknowledgements
This project was made possible by the excellent prior work of:
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 psf_parser-0.2.0.tar.gz.
File metadata
- Download URL: psf_parser-0.2.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e6b49586f18200f2e06a3e263db98997c52cf02c99cdc1307e1b12cec7596a2
|
|
| MD5 |
23e4ce134a371c6b744ee5e7c5f413b2
|
|
| BLAKE2b-256 |
aa7b16648b6f0c0357135c4e219f8b2dcd395d3e58261a4e2095f8d92c414a21
|
File details
Details for the file psf_parser-0.2.0-py3-none-any.whl.
File metadata
- Download URL: psf_parser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6892f949628ccb1a45619882d9be258a4adc2baf70c37dd6cb2695dc3dcae100
|
|
| MD5 |
8b97e10307491cc7abecf9db5be27181
|
|
| BLAKE2b-256 |
787ce3824b087a34b1363966ca8667c9ae83ca4c2a612b67953f2f9f5df74066
|