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.

Installation

Install package from PyPI distribution strx

pip install strx

Usage

Import into the script

import strx

For general string manipulation

strx.str_length
strx.str_sub
strx.str_trim
strx.str_reverse
strx.str_detect
strx.str_snakecase
strx.str_remove
strx.str_replace
strx.str_replace_all
strx.str_pad
strx.str_split
strx.str_count
strx.str_which
strx.str_sort
strx.str_unique
strx.str_dup
strx.str_c
strx.str_extract
strx.str_extract_all

Convert string to general cases

strx.str_to_upper
strx.str_to_lower
strx.str_to_title

Convert string into numeric (float, int) and ratio

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

strx.str_to_ratio("350:100")
3.5

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.2.14.tar.gz (7.1 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.2.14-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for strx-0.2.14.tar.gz
Algorithm Hash digest
SHA256 363ba42f5cd17fbeb1374b8c8ea60ef27a02c54f3369dcef89b50e3932548e16
MD5 b1a846abadaeae59f5149dbe0a0ce994
BLAKE2b-256 afa692b3ddaa94e1068264c5836bf128ab508ec20e5e1575b996a9eeef2833d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for strx-0.2.14.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.2.14-py3-none-any.whl.

File metadata

  • Download URL: strx-0.2.14-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ef95636efd98324e42d860f0ce05c65705511da21d7a45731b5739e06d78296a
MD5 388f7ca8db69f5feb7e9104a2c198714
BLAKE2b-256 70a0560cdef151299d90728a17dbec3901e5b91b6f6a871d8a9711a576db62fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for strx-0.2.14-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