Skip to main content

Simple Python library determining whether strings indicate truey or falsy values

Project description

py2be

Simple Python library determining whether strings indicate truey or falsy values.

PyPI version

Introduction

to-be is a library providing facilities for determine whether the truthyness of strings. It implemented in several languages: py2be is the Python implementation.

Table of Contents

Terminology

The term "truthy" is an unhelpfully overloaded term in the programming world, insofar as it is used to refer to the notion of "truthyness" - whether something can be deemed to be interpretable as truth - and also the true side of that interpretation. In this library, the former interpretation is used, leaving us with the following terms:

  • "truthy" - whether something can be can be deemed to be interpretable as having truth;
  • "falsey" - whether an object can be deemed to be interpretable as being false;
  • "truey" - whether an object can be deemed to be interpretable as being true;

For example, consider the following Python program:

from py2be import (
	string_is_falsey,
	string_is_truey,
	string_is_truthy,
)

s1 = "no"
s2 = "True"
s3 = "orange"

# "no" is validly truthy, and is falsey
assert string_is_falsey(s1)
assert !string_is_truey(s1)
assert string_is_truthy(s1)

# "True" is validly truthy, and is truey
assert !string_is_falsey(s2)
assert string_is_truey(s2)
assert string_is_truthy(s2)

# "orange" is not validly truthy, and is neither falsey nor truey
assert !string_is_falsey(s3)
assert !string_is_falsey(s3)
assert !string_is_truthy(s3)

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/py2be.

Dependencies

py2be has no (non-development) dependencies.

Dev Dependencies

py2be has no (additional) development dependencies.

Related projects

License

py2be is released under the 3-clause BSD license. See LICENSE 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

py2be-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file py2be-0.0.1.tar.gz.

File metadata

  • Download URL: py2be-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for py2be-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bfa6d131ac4f0ee5dc746090a52211a4bab0a773e94bdf7e19ffea8506b31e52
MD5 dca0490bb4adc10615ddeed371dd198a
BLAKE2b-256 eed489dba618f1872dff807492f8a5e8c914ca6b605ed0ff17a0f897cd1a1a2a

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