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.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

asbool-0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asbool-0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asbool-0.1.tar.gz
Algorithm Hash digest
SHA256 3985b66c2c5e1dee3f07ee92060389a2126f80208d0fb872b56f5ecdb0353ddf
MD5 35e32c37e8be2fb4f2223bff4c72265f
BLAKE2b-256 051dd2d925b4331c91ea73d4faa6ae07562ee88834dbd3b6f4ab2b8be39fb39b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asbool-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2af12a91ae3efe6462c33ab1fbdf266cb08bc6fe0750a6e0d01542d6f60706cf
MD5 48c3b8b4a0cc146a82f86721cdadf458
BLAKE2b-256 7240ac2da0492d2b60c26359a0cba731a6975ff35f381a73d4553ad6e3f1fbc9

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