Skip to main content

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.

PyPI version License: MIT Build Status

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 .sNp files.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

touchstone_parser-0.1.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

touchstone_parser-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file touchstone_parser-0.1.1.tar.gz.

File metadata

  • Download URL: touchstone_parser-0.1.1.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

Hashes for touchstone_parser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 16c4cc793e7890975ef49ab9c09f50f32b53c900af82c6f532e90bb0578deb32
MD5 8a4c8a8da03834443ea79a417a22b567
BLAKE2b-256 0aa181324c4620436653f95eda728e42f1bde915fab50228bc244bf71443f684

See more details on using hashes here.

File details

Details for the file touchstone_parser-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for touchstone_parser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7558011fd4c7ded3362e2bc294081715a42cf26ca7dbb7bcaffcae2486f458f
MD5 77162ae372c30d10f7aa2cba52c409ac
BLAKE2b-256 32ba4643e0940f26f5b96fc816e52a5be0add3395fa5f1951307b0c23e9b3b04

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