some functions to work with strings.
Project description
stringthings
a set of functions to work with strings:
-
splits
multisplitsimilar to the.split()method from the standardstrclass, but able to separate the string using multiple separators at once.split_dmmmysplits a date string in format 'dmmmy' (like '5jan23') into a list ['d', 'mmm', 'y'].
-
numbers
is_numericreturns True if the string represents a number, not limited to integers as the.isdigit()string method.get_numberextract the number represented by the string.
-
filenames
extensionsplits 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_folderreturns the folder containing the file,get_filereturns the file name,get_namereturns the name of the file without the extension,get_extensionreturns the extension of the file.
-
dates
is_datereturns True if the input string represents a date.format_datechange the format of the date represented by the string, as requested by the user.
-
compression
compresscompress the repeated items in a string sequence, i.e.: compress('1 2 2 2') returns '1 3*2'.expandexpand 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:
NumPyPandas
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2521ff404d31e981e1f658b892c1441541ed263105ccdccf5d35fce31bc00c
|
|
| MD5 |
eb40fbba75d31cfb145d253f8e050aa0
|
|
| BLAKE2b-256 |
f5f162b2b7ab164c73466ad54e9a91f8234be2dcf55c6a5e7dfbf151f86a3e7f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a6abdc60257adde43f290ff169048005a415be281988d7c8d61770344a81689
|
|
| MD5 |
418c20c0eb716d5717e6eae50e9365b4
|
|
| BLAKE2b-256 |
cf9aff6bc62d80fddc8371430bf1733f84b8547484c582c26fd45c4bf0709c63
|