Skip to main content

str_to_bool function for Python

Project description

🐍 Python strtobool

Convert string to boolean value using str_to_bool function.

🛠 Usage

from strtobool 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.

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

python_strtobool-1.0.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

python_strtobool-1.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

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