Python String Utils: Overview

This is a handy library to validate, manipulate and generate strings, which is:

  • Simple and “pythonic”

  • Fully documented and with examples!

  • 100% code coverage!

  • Tested against all officially supported Python versions: 3.5, 3.6, 3.7, 3.8.

  • Fast (mostly based on compiled regex)

  • Free from external dependencies

  • PEP8 compliant


>>> pip install python-string-utils

Checking installed version

>>> import string_utils
>>> string_utils.__version__
>>> '1.0.0' # (if '1.0.0' is the installed version)

Library structure

The library basically consists in the python package string_utils, containing the following modules:

  • (contains string check api)

  • (contains string transformation api)

  • (contains string generation api)

  • (contains library-specific errors)

  • (contains compiled regex FOR INTERNAL USAGE ONLY)

Plus a secondary package tests which includes several submodules. Specifically one for each test suite and named according to the api to test (eg. tests for is_ip() will be in and so on). All the public API are importable directly from the main package string_utils, so this:

>>> from string_utils.validation import is_ip

can be simplified as:

>>> from string_utils import is_ip

Function Indices