skillfed

str2bool

Convert string to boolean

str2bool v1.1 243.4K downloads/30d#8,797 on PyPI15
Permissive license DORMANT released

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 str2bool

uv

uv add str2bool

poetry

poetry add str2bool

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.6Topic :: Utilities

Tags

string to boolean conversionparse yes no to boolstr2boolconvert string booleancase insensitive bool parsing
string-parsinglegacy-unmaintained

More Utilities packages