booleanfix


Namebooleanfix JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/EDM115/booleanfix
SummaryFix for boolean variables in Python
upload_time2023-10-14 12:19:10
maintainer
docs_urlNone
authorEDM115
requires_python
licenseMIT License Copyright (c) 2023 EDM115 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords boolean fix python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # booleanfix

The most useless pip package so far  
[![PyPI version](https://badge.fury.io/py/booleanfix.svg)](https://pypi.org/project/booleanfix)
  
## 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.  
*Note* : Since v1.1.0, booleanfix also allows you to use `null` and `undefined` as `None`.

#### Behind the scenes

```python
true = True
false = False
null = None
undefined = None
```

## Usage

1. Install the package in your repo

```bash
pip install booleanfix==1.1.0
```

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

```bash
booleanfix==1.1.0
```

1. Use it in your code

	a. The classic way

	```python
	import booleanfix as bf

	print(isinstance(bf.true, bool))
	print(bf.false == False)
	```

	b. The easy way

	```python
	from booleanfix import true, false

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

## Example

```python
from booleanfix import true, false, null, undefined

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](https://github.com/EDM115/booleanfix/issues) or a [pull request](https://github.com/EDM115/booleanfix/pulls) if you want to contribute to this project

### How to build ?

```bash
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 ?

```bash
py -m pip install --upgrade pytest
py -m pytest
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Authors

* **EDM115** - *Initial work* - [EDM115](https://github.com/EDM115)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EDM115/booleanfix",
    "name": "booleanfix",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "boolean,fix,python",
    "author": "EDM115",
    "author_email": "EDM115 <dev@edm115.eu.org>",
    "download_url": "https://files.pythonhosted.org/packages/ca/ac/a6a9e165c78f4b92bbfa57f638aeff8692dbef32793f1ded36f70c939272/booleanfix-1.1.0.tar.gz",
    "platform": null,
    "description": "# booleanfix\r\n\r\nThe most useless pip package so far  \r\n[![PyPI version](https://badge.fury.io/py/booleanfix.svg)](https://pypi.org/project/booleanfix)\r\n  \r\n## The problem\r\n\r\nIf 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.\r\n\r\n## The solution\r\n\r\nThis very simple project gives you boolean variables like you're used to. It's as simple as that.  \r\n*Note* : Since v1.1.0, booleanfix also allows you to use `null` and `undefined` as `None`.\r\n\r\n#### Behind the scenes\r\n\r\n```python\r\ntrue = True\r\nfalse = False\r\nnull = None\r\nundefined = None\r\n```\r\n\r\n## Usage\r\n\r\n1. Install the package in your repo\r\n\r\n```bash\r\npip install booleanfix==1.1.0\r\n```\r\n\r\n**If you use a requirements file, add this line to it :**\r\n\r\n```bash\r\nbooleanfix==1.1.0\r\n```\r\n\r\n1. Use it in your code\r\n\r\n\ta. The classic way\r\n\r\n\t```python\r\n\timport booleanfix as bf\r\n\r\n\tprint(isinstance(bf.true, bool))\r\n\tprint(bf.false == False)\r\n\t```\r\n\r\n\tb. The easy way\r\n\r\n\t```python\r\n\tfrom booleanfix import true, false\r\n\r\n\tprint(isinstance(true, bool))\r\n\tprint(false == False)\r\n\t```\r\n\r\n## Example\r\n\r\n```python\r\nfrom booleanfix import true, false, null, undefined\r\n\r\narray = [1, 2, 3, 4, 5]\r\nfor i in range(len((array))):\r\n\tif array[i] % 2 == 0:\r\n\t\tarray[i] = true\r\n\telse:\r\n\t\tarray[i] = false\r\n\r\nprint(array)\r\n\r\nfor i in array:\r\n\tprint(type(i), isinstance(i, bool), i)\r\n\r\nif null == undefined:\r\n\tprint(\"null == undefined\")\r\n\r\nif array[5] == null:\r\n\tprint(\"array[5] == null\")\r\n```\r\n\r\n## Contributing\r\n\r\nFeel free to open an [issue](https://github.com/EDM115/booleanfix/issues) or a [pull request](https://github.com/EDM115/booleanfix/pulls) if you want to contribute to this project\r\n\r\n### How to build ?\r\n\r\n```bash\r\npy -m pip install --upgrade pip build twine setuptools wheel\r\npy -m build\r\npy -m twine check dist/*\r\n# Optional : publish to test.pypi.org\r\npy -m twine upload --repository testpypi dist/*\r\n# Or to pypi.org\r\npy -m twine upload dist/*\r\n```\r\n\r\n### How to test ?\r\n\r\n```bash\r\npy -m pip install --upgrade pytest\r\npy -m pytest\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\r\n\r\n## Authors\r\n\r\n* **EDM115** - *Initial work* - [EDM115](https://github.com/EDM115)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 EDM115  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Fix for boolean variables in Python",
    "version": "1.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/EDM115/booleanfix/issues",
        "Funding": "https://github.com/EDM115#support-me-",
        "Homepage": "https://github.com/EDM115/booleanfix"
    },
    "split_keywords": [
        "boolean",
        "fix",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45c45ba96cc73ea5a8979a12f1181c875fc4703deb431391320d7e7c442385e4",
                "md5": "a245b1596fa136c6a704d2ef437ba953",
                "sha256": "efa18bac6f5bc9137a821dd9a8a770b4f3037e8eaf11c036e2ac655b193d9874"
            },
            "downloads": -1,
            "filename": "booleanfix-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a245b1596fa136c6a704d2ef437ba953",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3941,
            "upload_time": "2023-10-14T12:19:05",
            "upload_time_iso_8601": "2023-10-14T12:19:05.616000Z",
            "url": "https://files.pythonhosted.org/packages/45/c4/5ba96cc73ea5a8979a12f1181c875fc4703deb431391320d7e7c442385e4/booleanfix-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "caaca6a9e165c78f4b92bbfa57f638aeff8692dbef32793f1ded36f70c939272",
                "md5": "42559d538f99cdd9c3b6d1da58a58632",
                "sha256": "6e7e92295f68f79ddc9f8ca7946a4232d7e61851fed19afd218b02595f011c24"
            },
            "downloads": -1,
            "filename": "booleanfix-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "42559d538f99cdd9c3b6d1da58a58632",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4093,
            "upload_time": "2023-10-14T12:19:10",
            "upload_time_iso_8601": "2023-10-14T12:19:10.268533Z",
            "url": "https://files.pythonhosted.org/packages/ca/ac/a6a9e165c78f4b92bbfa57f638aeff8692dbef32793f1ded36f70c939272/booleanfix-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-14 12:19:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EDM115",
    "github_project": "booleanfix",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "booleanfix"
}
        
Elapsed time: 2.35524s