Skip to main content

Consistent API for string workloads

Project description

StrX

Consistent API for string workloads


strx features

  • Consistent API: All functions start with str_* prefix and take a string as the first argument

  • Strict type checking: All functions use precise type hints to ensure safety and early error detection.

  • Comprehensive test suite: 100% coverage and zero errors

Installation

Install package from PyPI distribution strx

pip install strx

Usage

Import into the script

import strx

For general string manipulation

strx.str_snakecase
strx.str_reverse
strx.str_pad
strx.str_length
strx.str_sub
strx.str_trim
strx.str_count
strx.str_sort
strx.str_unique
strx.str_dup

For string pattern matching

strx.str_detect
strx.str_remove
strx.str_replace
strx.str_replace_all
strx.str_split
strx.str_which
strx.str_extract
strx.str_extract_all

Join strings

strx.str_concat("strx", "is", "awesome", sep=" ")
"strx is awesome"

Convert string to different cases, such as upper, lower, title

strx.str_to_upper("strx")
"STRX"
strx.str_to_lower("STRX")
"strx"
strx.str_to_title("strx")
"Strx"

Convert string into numeric (float, int)

strx.str_to_number("1,000,000.00", radix=".", delimiter=",")
1000000.0

strx.str_to_number("1.000.000,00", radix=",", delimiter=".")
1000000.0

strx.str_to_number("1_000_000,00", radix=",", delimiter="_")
1000000.0

or convert string into ratio

strx.str_to_ratio("350:100")
3.5

strx.str_to_ratio("88/8", sep_by="/")
11.0

Documentation:

Documentation document at folder docs/

Code Storage:

Repository: GitHub > Repository:strx

Releases:

Releases: GitHub > Repository:strx > Releases

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

strx-0.3.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

strx-0.3.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file strx-0.3.1.tar.gz.

File metadata

  • Download URL: strx-0.3.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for strx-0.3.1.tar.gz
Algorithm Hash digest
SHA256 cb80040b5bd7c96755e41639ae916cac1f9259c3519100b1e0a5fc768ac210fe
MD5 e18c47babf2afdd28ba3bc5392912b18
BLAKE2b-256 d4b9e058936be79db576698f003a1e114caa12284f87b78e8bbc96873e880622

See more details on using hashes here.

Provenance

The following attestation bundles were made for strx-0.3.1.tar.gz:

Publisher: publish.yml on thuyetbao/strx

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

File details

Details for the file strx-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: strx-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for strx-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 454261feace6372d10ec8050918840b509ddea1b0c6d378f73e65629e2341c76
MD5 5b80be90b7db0bf798a46737d511cb81
BLAKE2b-256 346607ee054cb42255737831c304b8ffe379d8ac16ee0230a67c5ea9321c9d14

See more details on using hashes here.

Provenance

The following attestation bundles were made for strx-0.3.1-py3-none-any.whl:

Publisher: publish.yml on thuyetbao/strx

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