Skip to main content

a package to convert the input value to a boolean type

Project description

a package to convert the input value to a boolean type

Usage

pip install yors_pano_str_to_bool
from yors_pano_str_to_bool import to_bool,text_to_bool,invert_bool_text

to_bool('true') # True
to_bool('false') # False
to_bool('enable') # True
to_bool('disable') # False
to_bool('1') # True
to_bool('0') # False
to_bool(True) # True
to_bool(False) # False

text_to_bool('true') # True
text_to_bool('false') # False
text_to_bool('enable') # True
text_to_bool('disable') # False
text_to_bool('1') # True
text_to_bool('0') # False
text_to_bool('on') # True
text_to_bool('0ff') # False

invert_bool_text('true') # 'false'
invert_bool_text('false') # 'true'
invert_bool_text('enable') # 'disable'
invert_bool_text('disable') # 'enable'
invert_bool_text('1') # '0'
invert_bool_text('0') # '1'
invert_bool_text('on') # 'off'
invert_bool_text('0ff') # 'on'

author

ymc-github ymc.github@gmail.com

license

MIT or APACHE-2.0

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

yors_pano_str_to_bool-1.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

yors_pano_str_to_bool-1.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file yors_pano_str_to_bool-1.1.0.tar.gz.

File metadata

  • Download URL: yors_pano_str_to_bool-1.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.6 Windows/10

File hashes

Hashes for yors_pano_str_to_bool-1.1.0.tar.gz
Algorithm Hash digest
SHA256 665e2e1199e0af438c984fd6f17ff2c6576189cb2c17ab30336a1e11faa569a8
MD5 2a6c44773771da508f8a89f1adcf626a
BLAKE2b-256 8c668ff7d99ad5918ff7dfe390979132fac6fd123ab915795ec3abb8873b5abe

See more details on using hashes here.

File details

Details for the file yors_pano_str_to_bool-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yors_pano_str_to_bool-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f8320e51dbb7f0914584786d5064c0ac4e0403250405efff62794b10e90e188
MD5 33362f5590258f26ccdab7f63c91409e
BLAKE2b-256 78b20b3a7a890ed6e8001226dd023fc145e14549200e8cc048d80a4855fd0c04

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