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
    • Handy functions to get the folder, the file name, or the extension from a full path:
      • get_folder returns the folder containing the file,
      • get_file returns the file name,
      • get_name returns the name of the file without the extension,
      • get_extension returns the extension of the file.
  • 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.9.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

stringthings-0.2.9-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file stringthings-0.2.9.tar.gz.

File metadata

  • Download URL: stringthings-0.2.9.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for stringthings-0.2.9.tar.gz
Algorithm Hash digest
SHA256 db2521ff404d31e981e1f658b892c1441541ed263105ccdccf5d35fce31bc00c
MD5 eb40fbba75d31cfb145d253f8e050aa0
BLAKE2b-256 f5f162b2b7ab164c73466ad54e9a91f8234be2dcf55c6a5e7dfbf151f86a3e7f

See more details on using hashes here.

File details

Details for the file stringthings-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: stringthings-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for stringthings-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6abdc60257adde43f290ff169048005a415be281988d7c8d61770344a81689
MD5 418c20c0eb716d5717e6eae50e9365b4
BLAKE2b-256 cf9aff6bc62d80fddc8371430bf1733f84b8547484c582c26fd45c4bf0709c63

See more details on using hashes here.

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