Skip to main content

some functions to work with strings.

Project description

stringthings

a set of functions to work with strings:

  • splits

    • multisplit similar to the .split() method from the standard str class, but able to separate the string using multiple separators at once.
    • split_dmmmy splits a date string in format 'dmmmy' (like '5jan23') into a list ['d', 'mmm', 'y'].
  • numbers

    • is_numeric returns True if the string represents a number, not limited to integers as the .isdigit() string method.
    • get_number extract the number represented by the string.
  • filenames

    • extension splits a fullpath represented by the string into:
      • the extension of the file
      • the name of the file
      • the directory containing the file
      • the input fullpath
  • dates

    • is_date returns True if the input string represents a date.
    • format_date change the format of the date represented by the string, as requested by the user.
  • compression

    • compress compress the repeated items in a string sequence, i.e.: compress('1 2 2 2') returns '1 3*2'.
    • expand expand the compressed string repetitions, i.e.: expand('1 3*2') returns '1 2 2 2'.

To install this package:

Install it from the pypi.org repository:
pip install stringthings
or upgrade to the latest version:
pip install --upgrade stringthings

Optional requisites:

The main functionalities are purely Python powered and does not require any other package to work but, if present, some functions requires NumPy and Pandas:

  • NumPy
  • Pandas

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

stringthings-0.2.8.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distribution

stringthings-0.2.8-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page