Python library for Touchstone .sNp parsing and S-parameter analysis in RF/microwave engineering.
Project description
touchstone.parser
Python library for Touchstone .sNp parsing and S‑parameter analysis in RF/microwave engineering.
touchstone.parser is a minimalist, polished, and community-friendly library designed for reproducibility and automation in RF/microwave workflows. It provides a clean API to parse .sNp files into structured Python objects with full support for NumPy.
Features
- Robust Parsing: Support for
.s1p,.s2p, up to.sNpfiles. - Full Metadata Support: Parses frequency units, parameter types (S, Y, Z, G, H), data formats (DB, MA, RI), and reference impedance.
- Scientific Integration: Direct conversion to NumPy arrays for easy analysis with SciPy and Matplotlib.
- Modular Design: Clean, type-hinted API designed for extensibility.
Installation
pip install touchstone.parser
Quickstart
from touchstone.parser import read_snp
# Load a 2-port Touchstone file
data = read_snp("measurements.s2p")
# Access frequency data (in Hz)
print(data.frequency)
# Access S-parameters as a NumPy array (shape: n_freq x 2 x 2)
print(data.s_parameters)
# Access magnitude and phase at a specific frequency
s21_mag = data.magnitude("S", 2, 1)
s21_phase = data.phase("S", 2, 1)
Contribution
Contributions are welcome! Please see our Contributing Guidelines for more details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 touchstone_parser-0.1.2.tar.gz.
File metadata
- Download URL: touchstone_parser-0.1.2.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c27d78119b6e2f40728e1e23124c65271aef06c7a48cf236fd20187fd6d83100
|
|
| MD5 |
fa7668b474d6f6f06b640be5331e8d03
|
|
| BLAKE2b-256 |
0a1a26c06c459970c27f8b6a60af937c6becb6167d7bfffb122f805674bf4a0c
|
File details
Details for the file touchstone_parser-0.1.2-py3-none-any.whl.
File metadata
- Download URL: touchstone_parser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4da25730af933fc812dd4772ea964e5b37f5758d456a178b223794b6deb2ec7a
|
|
| MD5 |
b22680e3d5c21d53c7958713298ca55d
|
|
| BLAKE2b-256 |
9b80603ce774512d2ad97de65425c68f9198cd81524786736fffd23f5c8773f6
|