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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for asbool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a3a9fdc993e5661c120923ec7cac9f6ee8deaa34cce6311025dba96a309579ba
MD5 8c22f29155ce871cfd2d0baab15b46c6
BLAKE2b-256 b673406a9bc7e82c5b1bffd2c72b29b3bff1a9c037ebe9d96fc9a871654ff90d

See more details on using hashes here.

File details

Details for the file asbool-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for asbool-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3dbf84bb93124eeb7d3620d0b86e9dd6a655ef4d0422be1715faed02bfcd212c
MD5 cecfa15de0112fbcfe7e5c58479e5c88
BLAKE2b-256 e25bc6503a86d4659441b7419a7716623a37134b81f469fd78103bb95bae8bb4

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