Skip to main content

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

Project description

https://travis-ci.org/aodag/asbool.svg?branch=master

asbool is simple converter from str to bool.

INSTALL

use pip to install asbool.

pip install asbool

USAGE

You can use asbool.asbool function simply.

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

Or use AsBoolConverter instance with customized values.

>>> from asbool.converter import AsBoolConverter
>>> converter = AsBoolConverter(['t'], ['f'])
>>> converter('t')
True
>>> converter('f')
False
>>> 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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file asbool-0.2.tar.gz.

File metadata

  • Download URL: asbool-0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.0

File hashes

Hashes for asbool-0.2.tar.gz
Algorithm Hash digest
SHA256 f2b79e8598a3f6c2e2599c643b109c510d19972c3fb81684e404983aadb7f953
MD5 289eb6a387b5925f27bda915705c562c
BLAKE2b-256 990e2c40bf7909e2161c083081a19332bec8e882dc7161b0f47c08ca2c4e25e8

See more details on using hashes here.

File details

Details for the file asbool-0.2-py3-none-any.whl.

File metadata

  • Download URL: asbool-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.0

File hashes

Hashes for asbool-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d223e24311914fe429b2c35f4d44e28592c42c8e3a76268adeebb582d0f1031
MD5 2f1a4a13dfb8dbd273142b5ba9d28f6c
BLAKE2b-256 cdd5ed7c21877339ecd7bde15dbe5ea8c9801df7356579335c678d3a2729108c

See more details on using hashes here.

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