Skip to main content

str2bool3 v1.0.0

About

Convert string to boolean.
The library recognizes "yes", "true", "y", "t", "1" as True, and "no", "false", "n", "f", "0" as False.
Case insensitive.

Installation

$ pip install str2bool3

Examples

Here's a basic example:

>>> from str2bool3 import StrUtils
>>> print(StrUtils.str2bool('Yes'))
True

To raise an exception on invalid input:

>>> from str2bool3 import StrUtils
>>> StrUtils.str2bool_exc('invalid')
ValueError: Invalid value 'invalid'. Expected one of: false, f, n, no, t, true, y, yes, 0, 1.

License

BSD

Forked from symonsoft/str2bool

Metadata

Release files for str2bool3 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for str2bool3 1.3.0
File Size Uploaded
str2bool3-1.3.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for str2bool3 1.3.0
File Interpreter ABI Platform
str2bool3-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / str2bool3-1.3.0.tar.gz

Download URL str2bool3-1.3.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be4ddb470e0be4f34b731d10d2456366ffddaa5901fe97691404cbd117c1bf37
BLAKE2b-256 checksum
How to use checksums
7fb0b66457dd5622a1a72502a0d5bd5d2353a1b80a499c2205705a2c22589251
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.7

Release files / str2bool3-1.3.0-py3-none-any.whl

Download URL str2bool3-1.3.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e92413c16cbb3c1683047806dd14c3dea3b4cac00e61caaf6295f6d6d589f7c
BLAKE2b-256 checksum
How to use checksums
7d3f04c069128ea4296803f974b9464178ad7f2eb5c42f03ec77ec28efd9702e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.7

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page