A General Use Python Tookit.
Project description
PyToolkit
Python General tools
Utilities
string_or_list
function allows you to interpret a string and return a list. Provides you the option of adding a delimeter using an OR function to return a possible string that you may be expecting possible commond delimeters. Such as: ",|:|\|, "
.
Example:
>>> from pytoolkit.utils import string_or_list
>>> test = 'string1,string2 string3|string4'
>>> string_or_list(test)
['string1,string2 string3|string4']
>>> string_or_list(test,delimeters=',| ')
['string1', 'string2', 'string3|string4']
>>> string_or_list(test,delimeters=',| |\|')
['string1', 'string2', 'string3', 'string4']
Releases
v0.0.3
- Added delimeter option.
- Allows you to specify the delimeter you want to use using an OR operation with
|
.
- Allows you to specify the delimeter you want to use using an OR operation with
- WARNING: this changes the default behavior to the original intent of turning a string to a string without using the default split(',').
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytoolkit928-0.0.3.tar.gz
(44.4 kB
view details)
Built Distribution
File details
Details for the file pytoolkit928-0.0.3.tar.gz
.
File metadata
- Download URL: pytoolkit928-0.0.3.tar.gz
- Upload date:
- Size: 44.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16a204e6b32ded1a81dad8792ea9721add8bb50dda9869e51dbbdb78f4d46355 |
|
MD5 | bf10722ed60a8359c4cf7736fb6f0267 |
|
BLAKE2b-256 | c7e7e606e2801daa855a92372d3a7c05428763503972d7f0df929f1e2dc8be34 |
File details
Details for the file pytoolkit928-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pytoolkit928-0.0.3-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d27b5856a81ab30bcb75191b91537386e0c0aa6510b81754c46199b57481d686 |
|
MD5 | 9fff665b5dbce3022829eec9d39bbb4a |
|
BLAKE2b-256 | 26f55e280e7146d28e73e175760fe3b15d799adf13ae914f8f82bdb6afdce49b |