Skip to main content

booleanfix

The most useless pip package so far
PyPI - Version PyPI - Downloads Pepy Total Downlods

The problem

If you come from another programming language, you may have noticed that Python's boolean variables are a bit different. This module aims to fix that, by giving you boolean variables like you're used to.

The solution

This very simple project gives you boolean variables like you're used to. It's as simple as that.

Behind the scenes

true = True
false = False
none = None
null = None
undefined = None

Usage

  1. Install the package in your repo
pip install booleanfix

If you use a requirements file, add this line to it :

booleanfix==1.2.0
  1. The classic way
import booleanfix as bf

print(isinstance(bf.true, bool))
print(bf.false == False)
  1. The easy way
from booleanfix import true, false

print(isinstance(true, bool))
print(false == False)
  1. The all-in-one way
from booleanfix import *

print(isinstance(true, bool))
print(false == False)

Example

from booleanfix import *

array = [1, 2, 3, 4, 5]
for i in range(len((array))):
	if array[i] % 2 == 0:
		array[i] = true
	else:
		array[i] = false

print(array)

for i in array:
	print(type(i), isinstance(i, bool), i)

if null == undefined:
	print("null == undefined")

if array[5] == null:
	print("array[5] == null")

Contributing

Feel free to open an issue or a pull request if you want to contribute to this project

How to build ?

py -m pip install --upgrade pip build twine setuptools wheel
py -m build
py -m twine check dist/*
# Optional : publish to test.pypi.org
py -m twine upload --repository testpypi dist/*
# Or to pypi.org
py -m twine upload dist/*

How to test ?

py -m pip install --upgrade pytest
py -m pytest

License

This project is licensed under the MIT License - see the LICENSE file for details

Authors

  • EDM115 - Initial work - EDM115

Metadata

Release files for booleanfix 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for booleanfix 1.2.0
File Size Uploaded
booleanfix-1.2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for booleanfix 1.2.0
File Interpreter ABI Platform
booleanfix-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / booleanfix-1.2.0.tar.gz

Download URL booleanfix-1.2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a41e2bed11d2e299bc97152ff921d2ef670ea3788b6dd95fb1d5105974b28007
BLAKE2b-256 checksum
How to use checksums
0988a422ccfde954d03ea51768f2d3a96c2b2ed9d442d34869474c5cc6e9dc74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / booleanfix-1.2.0-py3-none-any.whl

Download URL booleanfix-1.2.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2a4511a4055acab80f9d110b4b143e23b281d85ae4d654171e3326d08b9c87b
BLAKE2b-256 checksum
How to use checksums
cb34d91ca4638966c3d4948ec35b384bbc1e2b7b034c231befa6e0d7f334374b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page