python-strtobool

str_to_bool function for Python


Keywords
str_to_bool, strtobool, str2bool
License
Apache-2.0
Install
pip install python-strtobool==1.0.2

Documentation

🐍 Python strtobool

Convert string to boolean value using str_to_bool function.

🛠 Usage

from str_to_bool import str_to_bool

# Convert string to boolean value
value = str_to_bool('true')

📝 Supported values

All values are case-insensitive. Any value not listed below will raise a ValueError.

True values

  • true
  • t
  • yes
  • y
  • on
  • 1

False values

  • false
  • f
  • no
  • n
  • off
  • 0

📦 Installation

Pip

pip install python-strtobool

Poetry

poetry add python-strtobool

📜 License

This project is released under the Apache-2.0 License. See the LICENSE file for more details.