Skip to main content

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 |.
  • WARNING: this changes the default behavior to the original intent of turning a string to a string without using the default split(',').

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

pytoolkit928-0.0.3.tar.gz (44.4 kB view hashes)

Uploaded Source

Built Distribution

pytoolkit928-0.0.3-py3-none-any.whl (33.9 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