Skip to main content

simple converter from ``str`` to ``bool``

Project description

asbool is simple converter from str to bool.


use pip to install asbool.

pip install asbool


You can use asbool.asbool function simply.

>>> from asbool import asbool
>>> asbool('TRUE')

Or use AsBoolConverter instance with customized values.

>>> from asbool.converter import AsBoolConverter
>>> converter = AsBoolConverter(['t'], ['f'])
>>> converter('t')
>>> converter('f')
>>> converter('true')
Traceback (most recent call last):
raise ValueError(ss)
ValueError: true

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

asbool-0.2.tar.gz (4.1 kB view hashes)

Uploaded source

Built Distribution

asbool-0.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded py3

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