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
Release files for stringthings 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stringthings-0.2.9.tar.gz | 11.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stringthings-0.2.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.3 kB
Release files / stringthings-0.2.9.tar.gz
| Download URL | stringthings-0.2.9.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db2521ff404d31e981e1f658b892c1441541ed263105ccdccf5d35fce31bc00c
|
|
BLAKE2b-256 checksum How to use checksums |
f5f162b2b7ab164c73466ad54e9a91f8234be2dcf55c6a5e7dfbf151f86a3e7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.8
|
Release files / stringthings-0.2.9-py3-none-any.whl
| Download URL | stringthings-0.2.9-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a6abdc60257adde43f290ff169048005a415be281988d7c8d61770344a81689
|
|
BLAKE2b-256 checksum How to use checksums |
cf9aff6bc62d80fddc8371430bf1733f84b8547484c582c26fd45c4bf0709c63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.8
|