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.2.tar.gz (4.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: py2be-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e7e0fe2741cada7584cde6d82bf77f7054de5d50d2e80da926820a00f36e4d49
MD5 dd372a27b380a1f09f52023a6106635b
BLAKE2b-256 13e6f56eb5d8bd31d7cc47dfede81c51b94961ec8a8334c7ff178468cb4f6483

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