{"id":30138276,"url":"https://github.com/nodef/extra-boolean.python","last_synced_at":"2026-03-11T10:32:47.920Z","repository":{"id":53195349,"uuid":"351308075","full_name":"nodef/extra-boolean.python","owner":"nodef","description":"Boolean data type has two possible truth values to represent logic.","archived":false,"fork":false,"pushed_at":"2025-04-10T20:05:59.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-16T16:36:45.839Z","etag":null,"topics":["algebra","and","boolean","eq","extra","imply","logic","neq","nimply","not","or","parse","xor"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/extra-boolean/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-25T04:26:44.000Z","updated_at":"2025-04-10T20:06:03.000Z","dependencies_parsed_at":"2025-04-10T21:22:43.495Z","dependency_job_id":"9b0d720a-fb9c-46be-b771-b265a0b3759f","html_url":"https://github.com/nodef/extra-boolean.python","commit_stats":null,"previous_names":["nodef/extra-boolean.python","python3f/extra-boolean"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodef/extra-boolean.python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodef","download_url":"https://codeload.github.com/nodef/extra-boolean.python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30378095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algebra","and","boolean","eq","extra","imply","logic","neq","nimply","not","or","parse","xor"],"created_at":"2025-08-11T01:05:55.700Z","updated_at":"2026-03-11T10:32:47.901Z","avatar_url":"https://github.com/nodef.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Boolean] data type has two possible truth values to represent logic.\u003cbr\u003e\n📦 [PyPi](https://pypi.org/project/extra-boolean/),\n📰 [Pdoc](https://python3f.github.io/extra-boolean/),\n📘 [Wiki](https://github.com/python3f/extra-boolean/wiki).\n\nHere is my implementation of digital logic gates in software. That includes\nthe basic gates [not_], [and_], [or_], [xor]; their complements [nand], [nor],\n[xnor]; and 2 propositional logic (taught in discrete mathematics) gates\n[imply], [eq]; and their complements [nimply], [neq]. There is also a\nmultiplexer, called [select], and a `True` counter, called [count]. [count]\ncan help you make custom gates, such as an *alternate* concept of **xnor**\nwhich returns `True` only if all inputs are the same (standard [xnor] returns\n`True` if even inputs are `True`). All of them can handle upto 8 inputs.\n\n[parse] is influenced by [\"boolean\"] package, and is quite good at translating\n`str` to `bool`. It can also handle double negatives, eg. `not inactive`.\nYou know the [and_] of 2-inputs, but what of 1-input? What of 0? And what of\nthe other gates? I answer them here.\n\n\u003e Stability: Experimental.\n\n\u003cbr\u003e\n\n```python\nfrom extra_boolean import *\n\n\nparse(\"1\")\nparse(\"truthy\")\nparse(\"Not Off\")\nparse(\"Not Inactive\")\n# True\n\nparse(\"cold\")\nparse(\"inactive\")\nparse(\"Negative Yes\")\nparse(\"Negative Aye\")\n# False\n\nimply(True, False)\n# False\n\neq(False, False)\n# True\n\nxor(True, True, True)\n# True\n\nselect(1, True, False, True)\n# False           ^\n\ncount(True, False, True)\n# 2    ^            ^\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## Index\n\n| Function | Action                                     |\n| -------- | ------------------------------------------ |\n| [parse]  | Converts string to boolean.                |\n| [not_]   | Checks if value is false.                  |\n| [and_]   | Checks if all values are true.             |\n| [or_]    | Checks if any value is true.               |\n| [xor]    | Checks if odd no. of values are true.      |\n| [nand]   | Checks if any value is false.              |\n| [nor]    | Checks if all values are false.            |\n| [xnor]   | Checks if even no. of values are true.     |\n| [eq]     | Checks if antecedent ⇔ consequent (a ⇔ b). |\n| [neq]    | Checks if antecedent ⇎ consequent (a ⇎ b). |\n| [imply]  | Checks if antecedent ⇒ consequent (a ⇒ b). |\n| [nimply] | Checks if antecedent ⇏ consequent (a ⇏ b). |\n| [select] | Checks if ith value is true.               |\n| [count]  | Counts no. of true values.                 |\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## References\n\n- [How to Build Your Very First Python Package](https://www.freecodecamp.org/news/build-your-first-python-package/)\n- [Test Python package publishing with the Test Python Package Index](https://test.pypi.org)\n- [How to use setup.py to install dependencies only?](https://stackoverflow.com/q/30797124/1413259)\n- [install_requires vs requirements files](https://packaging.python.org/discussions/install-requires-vs-requirements/)\n- [What does the “-U” option stand for in pip install -U](https://stackoverflow.com/a/12435220/1413259)\n- [Getting Started With Testing in Python](https://realpython.com/python-testing/)\n- [Import parent directory for brief tests](https://stackoverflow.com/a/11452413/1413259)\n- [pytest: Most useful command-line options](https://docs.pytest.org/en/reorganize-docs/new-docs/user/commandlineuseful.html)\n- [How to do relative imports in Python?](https://stackoverflow.com/a/7541369/1413259)\n- [How do I use a keyword as a variable name?](https://stackoverflow.com/q/37968516/1413259)\n- [pdoc: Auto-generate API documentation for Python projects](https://pdoc3.github.io/pdoc/)\n- [Docstrings in Python](https://www.datacamp.com/community/tutorials/docstrings-python)\n- [PEP 257 -- Docstring Conventions](https://www.python.org/dev/peps/pep-0257/)\n- [PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/)\n- [Twine is asking for my password each time : how to use the .pypirc](https://stackoverflow.com/a/57936053/1413259)\n- [TravisCI: Building Pull Requests](https://docs.travis-ci.com/user/pull-requests/)\n- [TravisCI: Building a Python Project](https://docs.travis-ci.com/user/languages/python/)\n- [Creating a clean gh-pages branch](https://gist.github.com/ramnathv/2227408)\n- [How to show only next line after the matched one?](https://stackoverflow.com/a/14310555/1413259)\n- [How To Check If a Directory Exists In a Shell Script](https://www.cyberciti.biz/faq/howto-check-if-a-directory-exists-in-a-bash-shellscript/)\n- [How do I trim leading and trailing whitespace from each line of some output?](https://unix.stackexchange.com/a/102229/166668)\n- [Bash if..else Statement](https://linuxize.com/post/bash-if-else-statement/)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n[![](https://img.youtube.com/vi/6mMK6iSZsAs/maxresdefault.jpg)](https://www.youtube.com/watch?v=6mMK6iSZsAs)\n![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/extra-boolean.python)\n\n[Boolean]: https://realpython.com/python-boolean/#the-python-boolean-type\n[\"boolean\"]: https://www.npmjs.com/package/boolean\n[parse]: https://github.com/python3f/extra-boolean/wiki/parse\n[xor]: https://github.com/python3f/extra-boolean/wiki/xor\n[not_]: https://github.com/python3f/extra-boolean/wiki/not_\n[and_]: https://github.com/python3f/extra-boolean/wiki/and_\n[or_]: https://github.com/python3f/extra-boolean/wiki/or_\n[nand]: https://github.com/python3f/extra-boolean/wiki/nand\n[nor]: https://github.com/python3f/extra-boolean/wiki/nor\n[xnor]: https://github.com/python3f/extra-boolean/wiki/xnor\n[eq]: https://github.com/python3f/extra-boolean/wiki/eq\n[imply]: https://github.com/python3f/extra-boolean/wiki/imply\n[nimply]: https://github.com/python3f/extra-boolean/wiki/nimply\n[select]: https://github.com/python3f/extra-boolean/wiki/select\n[count]: https://github.com/python3f/extra-boolean/wiki/count\n[neq]: https://github.com/python3f/extra-boolean/wiki/neq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-boolean.python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodef%2Fextra-boolean.python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-boolean.python/lists"}