str2bool
Convert string to boolean
What it is and what it does
str2bool is a minimal utility that parses common string representations of truth values into Python booleans. It recognizes 'yes', 'true', 'y', 't', '1' as True and 'no', 'false', 'n', 'f', '0' as False, treating input case-insensitively. The package has no runtime dependencies and is designed as a drop-in function for simple string-to-bool conversion tasks.
The package is production-stable but dormant—its last release was 2017-12-25 and it receives no active development. It remains functional for its narrow use case but will not receive bug fixes or feature updates. The high install friction and lack of recent maintenance make it a legacy choice.
Use it for:
- Parse command-line arguments or config file values that come in as strings like 'yes'/'no' or 'true'/'false'
- Convert user input from web forms or APIs into boolean flags without writing custom parsing logic
- Handle legacy data imports where boolean values are stored as string representations
- Quick boolean coercion in scripts where case-insensitive parsing is needed
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts string representations like 'yes', 'true', '1', 'no', 'false', '0' to Python boolean values, case-insensitive.
No. While the package is permissively licensed and has no known vulnerabilities, its high install friction, dormant maintenance status (last release 2017-12-25), and lack of active development make it a poor choice for new projects. Only consider it if you're maintaining legacy code that already depends on it.
Install
str2bool on PyPI
pip
pip install str2booluv
uv add str2boolpoetry
poetry add str2boolInstalling str2bool
Before you install
Installation friction is high due to distribution as a .zip file. The package is dormant—last release was 2017-12-25 and last commit 2024-07-02—so expect no active maintenance or updates.
License in practice
Licensed under BSD (permissive), which allows commercial and private use with minimal restrictions.
Quickstart
pip install str2bool
from str2bool import str2bool
print(str2bool('Yes')) # True
print(str2bool('no')) # False
Verify before relying
- Whether the high install friction (.zip distribution) reflects current PyPI hosting or a historical artifact
- Whether Python 2.7 support claim (per classifiers) is actually functional or outdated
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 3,154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 243,415/month — #8,797 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: str2bool-1.1.zip
Keywords: str2bool
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
py2opsinpy2opsin converts IUPAC chemical names to…
permissive · top 15,000 on PyPI
boolean.pyParse, simplify, and compare boolean…
permissive · top 1,000 on PyPI
kanjizeConverts between Japanese kanji number…
permissive · top 15,000 on PyPI
pycosatProvides efficient Python bindings to PicoSAT,…
permissive · top 15,000 on PyPI
sqlalchemy-hanaProvides a SQLAlchemy dialect that enables you…
permissive · top 15,000 on PyPI
esp-bool-parserParses and evaluates boolean expressions from…
permissive · top 15,000 on PyPI
indic-numtowordsConverts non-negative integers to their word…
permissive · top 15,000 on PyPI
selfiesConverts between SELFIES (Self-Referencing…
permissive · top 15,000 on PyPI
textsearchFind and replace multiple strings in text with…
permissive · top 15,000 on PyPI