Skip to main content

String Pod

pypi python Build Status codecov

Matching texts across languages

Features

  • Normalize text with options
  • Check if a text contains a substring
  • Parse numbers from text
  • Compare pinyin of two texts

Usage

Contains

Check if a text contains a substring, with options.

stringpod contains "Hello, world!" "world"
stringpod contains "  Hello, world!  " "lo, wor" --options "strip_whitespace,ignore_case"
stringpod contains "歌曲(純音樂)" "(纯音乐)" --options "ignore_chinese_variant"

Normalize

Normalize text to a standard form.

stringpod normalize "Hello, World!!!"
stringpod normalize "    Hello,   World!!!" --options "all"
stringpod normalize "歌曲(純音樂)" --options "ignore_chinese_variant"

Normalizer Options

  • strip_whitespace: Strip whitespace (leading and trailing) from the text (default: False)
  • remove_whitespace: Remove whitespace (all whitespace characters) from the text (default: False)
    • strip_whitespace will not be needed if remove_whitespace is True
  • ignore_chinese_variant: Ignore Chinese variant (default: False)
  • ignore_case: Ignore case (default: False)
    • English will be converted to lowercase
    • Chinese will be converted to simplified Chinese
  • nfkc: Normalize to NFKC (default: True)

Number Parser

Parse numbers from text.

stringpod number "One hundred and twenty-three"
stringpod number "One hundred and twenty-three" --language "en"

Number Parser Options

  • language: Language of the number (default: en)

Compare Pinyin

Compare pinyin of two texts.

stringpod cmp-pinyin "你好" "你号"
stringpod cmp-pinyin "你好" "你号" --options "with_tone"
stringpod cmp-pinyin "你好" "你号" --options "spoken_tone"

Pinyin Options

  • with_tone: Whether to include the tone (default: False)
  • spoken_tone: Whether to use the spoken tone (default: False)

Development

poetry install -E dev -E docs -E test
poetry run pre-commit install

CLI Application

poetry run python -m stringpod.cli --help

Python API

poetry run python -m stringpod.stringpod --help

Testing

poetry run pytest # Run Pytest
poetry run python -m stringpod.stringpod -v # Run Doctests

Credits

Core packages:

This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for stringpod 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stringpod 0.2.2
File Size Uploaded Provenance
stringpod-0.2.2.tar.gz 12.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for stringpod 0.2.2
File Interpreter ABI Platform
stringpod-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / stringpod-0.2.2.tar.gz

Download URL stringpod-0.2.2.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
32e8068bbc2eeb3d78fc23eca38606067af3617d3ebcae209215518591213f7f
BLAKE2b-256 checksum
How to use checksums
a65e096ed38d7a79e470af4e713dc98897d9f433d8433bed2fde515cb6934b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

Release files / stringpod-0.2.2-py3-none-any.whl

Download URL stringpod-0.2.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afc60de9f9ecfb4997986c0c5f7dcfb9eca07f58bb6e01b467a1dd9b1d91d378
BLAKE2b-256 checksum
How to use checksums
2248aefed8a00bb89fc751d597f0b1e7ec27e591c0a476853bd0ef1ed5467837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

Security for stringpod 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for stringpod-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page