Skip to main content

Easily convert common strings to boolean

Project description

Booleanify

Inspired by Pydantic's boolean, Booleanify is a Python package that provides a simple utility for converting strings representing boolean values into actual boolean values.

Installation

You can install Booleanify using pip:

pip install booleanify

Usage

To use Booleanify in your Python code, simply import the booleanify function and pass a string representing a boolean value to it. The function will return the corresponding boolean value.

from booleanify import booleanify

result = booleanify("T")
print(result)  # Output: True

result = booleanify("false")
print(result)  # Output: False

Booleanify supports the following string representations for boolean values:

Input Output
1 True
'1' True
'on' True
't' True
'true' True
'y' True
'yes' True
0 False
'off' False
'f' False
'false' False
'n' False
'no' False

Contribution

If you have any suggestions, improvements, or issues regarding Booleanify, feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

booleanify-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

booleanify-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: booleanify-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.9 Linux/5.4.0-169-generic

File hashes

Hashes for booleanify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b27582b9c89b6fc9c39cca0138490d2e29fd89ba745ed1198e1e3770bbaa5854
MD5 6aeacd7a51a4208f6bdb2ab77c058674
BLAKE2b-256 19b0f6c99dfcf69f3236f4894d79d920f019e11809ba108122c4265a045479bf

See more details on using hashes here.

File details

Details for the file booleanify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: booleanify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.11.9 Linux/5.4.0-169-generic

File hashes

Hashes for booleanify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8be1fe3fd7b4ce1d1bb7abc83b54a51547b0130f8734cc0a00a35ec211a2c204
MD5 21badf3a760b81c039dee69fdd6be4a9
BLAKE2b-256 cec9ade70b88e7641a9513c70c57d1003d08ca367582576afe709d534d048fae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page