Skip to main content

Text processing utilities for scientific workflows — LaTeX formatting, colored output, string parsing, and plot text helpers

Project description

SciTeX Str (scitex-str)

Text processing utilities for scientific workflows

PyPI version Tests License: AGPL-3.0

pip install scitex-str


Problem

Scientific Python code frequently needs LaTeX-style formatting for axis labels, colored terminal output for debugging, and structured string parsing for file paths and templates. These are scattered across ad-hoc helper functions in every project.

Solution

scitex-str provides a single package for text utilities commonly needed in scientific workflows:

  • LaTeX formatting -- convert variable names to LaTeX style, with automatic fallback when LaTeX is unavailable
  • Colored terminal output -- printc and color_text for styled console messages
  • String parsing -- bidirectional parse() to extract variables from path patterns
  • Plot text helpers -- format axis labels, titles, and tick labels for publication figures
  • Numeric formatting -- factor out common digits, human-readable byte sizes

Installation

Requires Python >= 3.10.

pip install scitex-str

SciTeX users: pip install scitex already includes this. Use import scitex then scitex.str.

Quick Start

import scitex_str as ss

# LaTeX-style formatting
ss.to_latex_style("theta")        # r"$\theta$"
ss.safe_to_latex_style("unknown") # "unknown" (no error)

# Colored terminal output
ss.printc("Success!", color="green")
ss.ct("Warning", color="yellow")  # returns colored string

# Parse structured paths
result = ss.parse("./data/Patient_23/Hour_12", "./data/Patient_{id}/Hour_{hour}")
# {'id': 23, 'hour': 12}

# Format plot text
ss.format_plot_text("amplitude_mv")  # "Amplitude [mV]"

# Human-readable bytes
ss.readable_bytes(1_500_000)  # "1.43 MB"

Part of SciTeX

scitex-str is part of SciTeX, a Python framework for scientific research automation.

Module Package Role
scitex.str scitex-str Text processing utilities
scitex.stats scitex-stats Statistical testing
scitex.io scitex-io Universal file I/O
scitex.plt figrecipe Publication-ready figures

scitex.ai

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

scitex_str-0.1.1.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

scitex_str-0.1.1-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_str-0.1.1.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_str-0.1.1.tar.gz
Algorithm Hash digest
SHA256 101ff65524f65a12e1d97cbad7884e546c30dae61f83efc7aed7f7c6e0982b90
MD5 6c9a01f718f057fbfd830d3d70c2ac7d
BLAKE2b-256 274e5a9e9d8aad0ddffa5ebbe1a409b56a9621c53d499dcf65fa390bfdcb2162

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_str-0.1.1.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-str

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: scitex_str-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_str-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21813262e1aebdf495a96bf599e30dce31706182cb5d90fd92c3ff3d0a8b3478
MD5 1db24a498214265c352890b14ceb4d9c
BLAKE2b-256 d0d4a1be3f9b97a560aa252aa6ee1039411a800e729b0d687a97396261d490df

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_str-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-str

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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