{"id":27165057,"url":"https://github.com/leomariga/pytruthtable","last_synced_at":"2026-04-10T20:52:54.316Z","repository":{"id":57458041,"uuid":"206834144","full_name":"leomariga/pyTruthTable","owner":"leomariga","description":"A python tool for logic clauses analysis and binary operations","archived":false,"fork":false,"pushed_at":"2020-07-02T00:32:47.000Z","size":625,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T00:38:11.625Z","etag":null,"topics":["pandas","pandas-dataframe","python","table","truth","truth-table","truth-table-generator"],"latest_commit_sha":null,"homepage":"https://leomariga.github.io/pyTruthTable/","language":"Jupyter Notebook","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/leomariga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-06T16:31:48.000Z","updated_at":"2021-10-27T16:31:17.000Z","dependencies_parsed_at":"2022-09-07T04:10:47.475Z","dependency_job_id":null,"html_url":"https://github.com/leomariga/pyTruthTable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomariga%2FpyTruthTable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomariga%2FpyTruthTable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomariga%2FpyTruthTable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomariga%2FpyTruthTable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leomariga","download_url":"https://codeload.github.com/leomariga/pyTruthTable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968240,"owners_count":21025798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["pandas","pandas-dataframe","python","table","truth","truth-table","truth-table-generator"],"created_at":"2025-04-09T02:50:59.872Z","updated_at":"2026-04-10T20:52:54.253Z","avatar_url":"https://github.com/leomariga.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/leomariga/pyTruthTable/master/doc/logo.png\"\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n-----------------\n[![PyPI Latest Release](https://img.shields.io/pypi/v/pyTruthTable.svg?style=for-the-badge)](https://pypi.org/project/pyTruthTable/)\n[![License](https://img.shields.io/pypi/l/pyTruthTable.svg?style=for-the-badge)](https://github.com/leomariga/pyTruthTable/blob/master/LICENSE)\n\n## What is pyTruthTable?\n**_pyTruthTable_** is a python library to create logical tables and make relations between its elements. It makes possible prepositional logic clauses analysis and  binary operations to be used in classic logical problems.\n\n#### Features:\n - Uses Pandas Dataframe.\n - Big set of logic operations.\n - Simplified function calls.\n - Automatic column naming.\n - Customizible appearence.\n\n\n## Installation\nRequirements: Python 3 and [Pandas](https://github.com/pandas-dev/pandas).\n\nInstall with [Pypi](https://pypi.org/project/pyTruthTable/):\n\n```sh\npip3 install pyTruthTable\n```\n\n### Take a look: \n\n##### Example 1 - Binary operations\n\n``` python\nimport pyTruthTable as ptt\n\n# Initialize\nt_table = ptt.PyTruthTable([\"A\", \"B\"])\n\n# Create relations\nt_table.append(\"not\", \"A\")\nt_table.append(\"and\", \"A\", \"B\")\nt_table.append(\"or\", 2, \"B\")    # Use the column index or name\nt_table.append(\"xor\", -2, -1)\nt_table.append(\"nand\", -1, 0, name = \"C\") # Rename column\nt_table.append(\"equals\", \"C\", \"A\")\n```\n\n|   A   |   B   |  ¬ A  | A ^ B | ¬ A v B | (A ^ B) ⊕ (¬ A v B) |   C  | C ↔ A |\n|:-----:|:-----:|:-----:|:-----:|:-------:|:-------------------:|:----:|:-----:|\n|  True |  True | False |  True |   True  |        False        | True |  True |\n|  True | False | False | False |  False  |        False        | True |  True |\n| False |  True |  True | False |   True  |         True        | True | False |\n| False | False |  True | False |   True  |         True        | True | False |\n\n##### Example 2 - Prepositional logic clauses\n\n``` python\nimport pyTruthTable as ptt\n\n# Initialize\ntt = ptt.PyTruthTable([\"Hot\", \"Wet\", \"Rains\"])\n\n# Append new column with specified operation\ntt.append(\"and\", \"Hot\", \"Wet\")\ntt.append(\"implies\", 3, \"Rains\")\n```\n\n|  Hot  |  Wet  | Rains | Hot ^ Wet | (Hot ^ Wet) → (Rains) |\n|:-----:|:-----:|:-----:|:---------:|:---------------------:|\n|  True |  True |  True |    True   |          True         |\n|  True |  True | False |    True   |         False         |\n|  True | False |  True |   False   |          True         |\n|  True | False | False |   False   |          True         |\n| False |  True |  True |   False   |          True         |\n| False |  True | False |   False   |          True         |\n| False | False |  True |   False   |          True         |\n| False | False | False |   False   |          True         |\n\n### See more examples here\n\n\n## Documentation \u0026 other links\n - The [amazing documentation is this Ṕage](https://leomariga.github.io/pyTruthTable/).\n - Source code in the [Github repository](https://github.com/leomariga/pyTruthTable).\n - [Pypi pakage installer](https://pypi.org/project/pyTruthTable/)\n\n\n## License\n[MIT](https://github.com/leomariga/pyTruthTable/blob/master/LICENSE)\n\n## Contributing is awesome!\n\nSee [CONTRIBUTING](https://github.com/leomariga/pyTruthTable/blob/master/CONTRIBUTING.md)\n\n\n\n\n## Contact\n\nDeveloped with :heart: by [Leonardo Mariga](https://github.com/leomariga) \n\nleomariga@gmail.com\n\nDid you like it? Remember to click on :star2: button.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleomariga%2Fpytruthtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleomariga%2Fpytruthtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleomariga%2Fpytruthtable/lists"}