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.0.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.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: touchstone_parser-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 44b9998dd88c5855ee6c5c50dae3c4c9c15f281452d05e771a0cff16955ae4f8
MD5 bcf76134df5afcc4c926e76047fc5cd3
BLAKE2b-256 a5c6b2c9a1f3559b61dfe81e4524f170f2f98b0285004a8696b72460483dfeab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for touchstone_parser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d5fd90f62238cf51afa61d455d0681bd85004add2dee97edde08010b10275ed
MD5 fc3b062fcdbf6c0703e0bf7d9f3af7fa
BLAKE2b-256 3290042cc20eb62a4b31d2c387461f941311744b68baf724507f2d4b3321a3dc

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