{"id":21581547,"url":"https://github.com/thoughtscript/python_api_2023","last_synced_at":"2026-04-04T21:32:45.617Z","repository":{"id":156876248,"uuid":"594864082","full_name":"Thoughtscript/python_api_2023","owner":"Thoughtscript","description":"Some fun with Flask, Python, and Machine Learning","archived":false,"fork":false,"pushed_at":"2025-09-16T20:34:34.000Z","size":359,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:34:18.597Z","etag":null,"topics":["angular","docker","docker-compose","flask","machine-learning","mysql","numpy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thoughtscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-29T21:27:12.000Z","updated_at":"2025-09-16T20:34:37.000Z","dependencies_parsed_at":"2024-06-23T06:35:37.725Z","dependency_job_id":"d4eb5cd0-6227-4484-af0b-7bcfbdfd0238","html_url":"https://github.com/Thoughtscript/python_api_2023","commit_stats":null,"previous_names":["thoughtscript/python_api_2023"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Thoughtscript/python_api_2023","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fpython_api_2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fpython_api_2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fpython_api_2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fpython_api_2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thoughtscript","download_url":"https://codeload.github.com/Thoughtscript/python_api_2023/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fpython_api_2023/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31415110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"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":["angular","docker","docker-compose","flask","machine-learning","mysql","numpy"],"created_at":"2024-11-24T14:12:53.886Z","updated_at":"2026-04-04T21:32:45.584Z","avatar_url":"https://github.com/Thoughtscript.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python_api\r\n\r\n[![](https://img.shields.io/badge/Python-3.13.7-yellow.svg)](https://www.python.org/downloads/) [![](https://img.shields.io/badge/Angular-v15-1976d2.svg)](https://angular.io/) [![](https://img.shields.io/badge/Docker-blue.svg)](https://www.docker.com/) [![](https://img.shields.io/badge/Bitnami-MySQL-red.svg)](https://hub.docker.com/r/bitnami/mysql)\r\n\r\nThis example is actually three examples in one (sorry, crunched for time!):\r\n\r\n1. A basic CRUD REST API with backing database and minimum viable User Interface built in Angular.\r\n2. A suite of [Machine Learning models](backend/ml/README.md) built to *teach* a computer how to use (Classical, [Zero Order](https://www.thoughtscript.io/papers/000000000001)) logic (*Statistically*, through Linear Regression rather than to stipulate Boolean Algebra as such through *Imperative* programming languages) whilst adding XOR, NAND, and Biconditional. Philosophically this aligns with [Putnam's](https://philpapers.org/rec/PUTILE) approach.\r\n    * Unit Tests are supplied in the [Python scripts](backend/ml/README.md).\r\n3. To expose those Machine Learning models through an API accessible only through [Postman](postman/Python%20ML%20API.postman_collection.json) since examples about how to do this easily seem lacking.\r\n    * Integration Tests are defined in the [Postman Collection](postman/Python%20ML%20API.postman_collection.json).\r\n\r\n## Use\r\n\r\nRun the following from the root dir:\r\n\r\n```bash\r\ndocker-compose up\r\n\r\n# If using Docker Compose Engine V2:\r\ndocker compose up\r\n```\r\n\r\nThat should spin up each subservice. Otherwise, you can launch each service individually by:\r\n\r\n1. Commenting out everything in `docker-compose.yml` except for:\r\n\r\n    ```yml\r\n    services:\r\n      mysql:\r\n       image: 'bitnami/mysql:8.0'\r\n      ports:\r\n        - '3306:3306'\r\n      environment:\r\n        - ALLOW_EMPTY_PASSWORD=yes\r\n        - MYSQL_USER=example\r\n        - MYSQL_PASSWORD=example\r\n        - MYSQL_DATABASE=example\r\n        - MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password\r\n    ```\r\n\r\n    Then launching the MySQL subservice via `docker-compose up`.\r\n2. From within `/angular` run `npm i \u0026\u0026 npm i angular/cli -g`, then `ng serve -o` to spin up the Angular frontend.\r\n3. From within `/backend` run:\r\n\r\n    ```bash\r\n    cd ml \r\n    python3 -m pip install --upgrade pip\r\n    python3 -m pip install -r requirements.txt\r\n    python3 ml-conjunction.py\r\n    python3 ml-disjunction.py \r\n    python3 ml-implication.py\r\n    python3 ml-negation.py\r\n    python3 ml-nand.py\r\n    python3 ml-xor.py\r\n    python3 ml-biconditional.py\r\n    python3 ml-triviality-f.py\r\n    python3 ml-triviality-t.py\r\n    python3 ml-nor.py\r\n    ```\r\n\r\n   To generate the Machine Learning models.\r\n\r\n4. Lastly, to start the backend service - from within `/backend` run:\r\n\r\n    ```bash\r\n    cd backend \r\n    python3 -m pip install --upgrade pip\r\n    python3 -m pip install -r requirements.txt\r\n    python3 main.py\r\n    ```\r\n\r\n\u003e Generally speaking, the necessary config, settings, and commands are available within [docker-compose.yml](docker-compose.yml), backend [dockerfile](backend/dockerfile), frontend [dockerfile](angular/dockerfile), [angular.json](angular/angular.json), and [main.py](backend/server/main.py), respectively. So, please make recourse to those if you encounter problems.\r\n\r\n## Notes\r\n\r\n\u003e **NOTE**: `MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password` is deprecated in `8.4` - for now I've pinned the version to `8.0` which is likely the closest to what I was using in early Spring 2024 - you may need to clean your local images and volumes via something like `docker system prune --volumes` since the Bitnami container may throw the following error message otherwise: `The designated data directory /bitnami/mysql/data/ is unusable.`) \r\n\r\n## Angular Frontend\r\n\r\nWill be exposed on:\r\n* Docker: `http://localhost:4201`\r\n* Standalone: `http://localhost:4200`\r\n\r\n## API Endpoints\r\n\r\nAPI endpoints are exposed through Docker or by running each subservice individually.\r\n\r\n### Test API\r\n\r\nA test endpoint to verify that requests are getting through and the app is exposed correctly through Docker:\r\n* Docker `http://localhost:5001/api/hello`\r\n* Standalone `http://localhost:5000/api/hello`\r\n\r\n### Logic API\r\n\r\nGenerates Boolean, bivalent, classical, logic results from ***Deep Learning Linear Regression*** models (it doesn't use in-built programmatic, native, Boolean clauses or ***Automated Theorem Proving*** techniques). \r\n\r\nAlso, inferences are included that exceed the standard Boolean operations (**Material Conditional**/**Implication**, **Conjunction**, **Disjunction**, **Negation** - for example: **NAND**).\r\n\r\n\u003e This mirrors research into how one might try to ***teach*** a computer logic ***rather than just stipulate how logic works*** like we do within programming languages. Read more [here](backend/ml/README.md).\r\n\r\n1. **Negation**\r\n    * \"NOT\" - Reverses the truth value of the supplied expression.\r\n    * Supply sequences of `0,0` (`False`) or `1,1` (`True`)\r\n    * Will reject any invalid pair (e.g. - `1,0`, `0,1`)\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:\r\n        * `1,1` at index `i` will map to `false` at index `i`.\r\n    * Docker: `POST http://localhost:5001/api/logic/negation?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone: `POST http://localhost:5000/api/logic/negation?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                false,\r\n                true,\r\n                false,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ```\r\n\r\n1. **Conjunction**\r\n    * \"AND\" - Evaluates `True` only if both conjuncts are `True`.\r\n    * Supply sequences of `0,1` (left conjunct `False`, right conjunct `True`), `1,1` (left conjunct `True`, right conjunct `True`), `1,0` (left conjunct `True`, right conjunct `False`), `0,0` (left conjunct `False`, right conjunct `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,1` at index `i` will map to `true` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/conjunction?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/conjunction?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],  \r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                true,\r\n                false,\r\n                false,\r\n                false,\r\n                true,\r\n                false,\r\n                false,\r\n                false\r\n            ]\r\n        ]\r\n    ]\r\n    ```\r\n\r\n1. **Implication**\r\n    * \"Material Implication\" - Evaluates `False` only if the antecedant is `True` and the consequent `False`. (Not to be confused with the imperative conditional - e.g. `if { ... }` in most programming languages.)\r\n    * Supply sequences of `0,1` (antecedant `False`, consequent `True`), `1,1` (antecedant `True`, consequent `True`), `1,0` (antecedant `True`, consequent `False`), `0,0` (antecedant `False`, consequent `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `false` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/implication?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/implication?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                true,\r\n                true,\r\n                false,\r\n                true,\r\n                true,\r\n                true,\r\n                false,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ```\r\n\r\n1. **Disjunction**\r\n    * \"OR\" - Evaluates `True` if either disjunct is `True` (or both).\r\n    * Supply sequences of `0,1` (left disjunct `False`, right disjunct `True`), `1,1` (left disjunct `True`, right disjunct `True`), `1,0` (left disjunct `True`, right disjunct `False`), `0,0` (left disjunct `False`, right disjunct `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `true` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/disjunction?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/disjunction?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                true,\r\n                false,\r\n                true,\r\n                true,\r\n                true,\r\n                false,\r\n                true,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ```\r\n\r\n1. **NAND**\r\n    * \"NOT-AND\" - Evaluates `True` only if the expression isn't a `True` **Conjunction**.\r\n    * Supply sequences of `0,1` (left conjunct `False`, right conjunct `True`), `1,1` (left conjunct `True`, right conjunct `True`), `1,0` (left conjunct `True`, right conjunct `False`), `0,0` (left conjunct `False`, right conjunct `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `true` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/nand?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/nand?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                false,\r\n                true,\r\n                true,\r\n                true,\r\n                false,\r\n                true,\r\n                true,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ```\r\n\r\n1. **XOR**\r\n    * \"Exclusive OR\" - Evaluates `True` only if neither disjunct is the same. (Evaluates `True` if either disjunct is `True` but not both.)\r\n    * Supply sequences of `0,1` (left disjunct `False`, right disjunct `True`), `1,1` (left disjunct `True`, right disjunct `True`), `1,0` (left disjunct `True`, right disjunct `False`), `0,0` (left disjunct `False`, right disjunct `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `true` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/xor?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1|0,0|1,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/xor?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1|0,0|1,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                false,\r\n                false,\r\n                true,\r\n                true,\r\n                false,\r\n                false,\r\n                true,\r\n                true,\r\n                false,\r\n                true,\r\n                true,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ``` \r\n\r\n1. **Biconditional**\r\n    * \"Two Directional Material Conditionals\" (\"Necessary and Sufficient\") - Evaluates `True` if both sides are the same.\r\n    * Supply sequences of `0,1` (left side `False`, right side `True`), `1,1` (left side `True`, right side `True`), `1,0` (left side `True`, right side `False`), `0,0` (left side `False`, right side `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `false` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/biconditional?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1|0,0|1,0|1,0|0,1|0,0|1,1`\r\n    * Standalone `POST http://localhost:5000/api/logic/biconditional?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1|0,0|1,0|1,0|0,1|0,0|1,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                true,\r\n                true,\r\n                false,\r\n                false,\r\n                true,\r\n                true,\r\n                false,\r\n                false,\r\n                true,\r\n                false,\r\n                false,\r\n                false,\r\n                true,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ``` \r\n\r\n1. **Triviality-T**\r\n    * \"Triviality-T\" - Evaluates `True` regardless. (Consequence of the [Principle of Explosion](https://dimap.ufrn.br/~jmarcos/papers/JM/01-CM-ECNSQL.pdf) or *ex contradictione sequitur quodlibet* or *Triviality* - a logic that collapses into *Triviality* is insufficient for reasoning. Also, here to better fill out the [Hasse Diagram](http://finitegeometry.org/sc/16/logic.html) and Lattice.)\r\n    * Supply sequences of `0,1` (left argument `False`, right argument `True`), `1,1` (left argument `True`, right argument `True`), `1,0` (left argument `True`, right argument `False`), `0,0` (left argument `False`, right argument `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `true` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/trivialityt?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5001/api/logic/trivialityt?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                true,\r\n                true,\r\n                true,\r\n                true,\r\n                true,\r\n                true,\r\n                true,\r\n                true\r\n            ]\r\n        ]\r\n    ]\r\n    ``` \r\n\r\n1. **Triviality-F**\r\n    * \"Triviality-F\" - Evaluates `False` regardless. (Consequence of the [Principle of Explosion](https://dimap.ufrn.br/~jmarcos/papers/JM/01-CM-ECNSQL.pdf) or *ex contradictione sequitur quodlibet* or *Triviality* - a logic that collapses into *Triviality* is insufficient for reasoning. Also, here to better fill out the [Hasse Diagram](http://finitegeometry.org/sc/16/logic.html) and Lattice.)\r\n    * Supply sequences of `0,1` (left argument `False`, right argument `True`), `1,1` (left argument `True`, right argument `True`), `1,0` (left argument `True`, right argument `False`), `0,0` (left argument `False`, right argument `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `false` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/trivialityt?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5001/api/logic/trivialityt?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                false,\r\n                false,\r\n                false,\r\n                false,\r\n                false,\r\n                false,\r\n                false,\r\n                false\r\n            ]\r\n        ]\r\n    ]\r\n    ``` \r\n\r\n1. **NOR**\r\n    * \"Neither Nor\" - Evaluates `True` only if neither disjunct is `True`.\r\n    * Supply sequences of `0,1` (left disjunct `False`, right disjunct `True`), `1,1` (left disjunct `True`, right disjunct `True`), `1,0` (left disjunct `True`, right disjunct `False`), `0,0` (left disjunct `False`, right disjunct `False`).\r\n    * Each result will contain two parts with each entry in the first mapped to the result in the second by same index:  \r\n        * `1,0` at index `i` will map to `false` at index `i`.\r\n    * Docker `POST http://localhost:5001/api/logic/nor?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n    * Standalone `POST http://localhost:5001/api/logic/nor?test=1,1|0,0|1,0|0,1|1,1|0,0|1,0|0,1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        [\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ],\r\n            [\r\n                1,\r\n                1\r\n            ],\r\n            [\r\n                0,\r\n                0\r\n            ],\r\n            [\r\n                1,\r\n                0\r\n            ],\r\n            [\r\n                0,\r\n                1\r\n            ]\r\n        ],\r\n        [\r\n            [\r\n                false,\r\n                true,\r\n                false,\r\n                false,\r\n                false,\r\n                true,\r\n                false,\r\n                false\r\n            ]\r\n        ]\r\n    ]\r\n    ``` \r\n\r\n### DB API\r\n\r\nSupports RESTful CRUD (***CREATE***, ***READ***, ***UPDATE***, ***DELETE***) operations against a backing MySQL DB.\r\n\r\n\u003e Check out the [Example SQL Domain](backend/server/domain/__init__.py) entry.\r\n\r\n1. **Scan**\r\n    * Retrieve all prepopulated entries from the MySQL DB.\r\n    * Docker `GET http://localhost:5001/api/db/examples`\r\n    * Standalone `GET http://localhost:5000/api/db/examples`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\"{ id: 1, name: 'example_a' }\",\"{ id: 2, name: 'example_b' }\",\"{ id: 3, name: 'example_c' }\",\"{ id: 4, name: 'example_d' }\"]\r\n    ```\r\n\r\n1. **Get One**\r\n    * Retrieve one Example by ID.\r\n    * Docker `GET http://localhost:5001/api/db/example/1`\r\n    * Standalone `GET http://localhost:5000/api/db/example/1`\r\n\r\n    Response:\r\n    ```JSON\r\n    [\"{ id: 1, name: 'example_a' }\"]\r\n    ```\r\n\r\n1. **Create Example**\r\n    * Create an Example with `form-data`.\r\n    * Docker `POST http://localhost:5001/api/db/example`\r\n    * Standalone `POST http://localhost:5000/api/db/example`\r\n\r\n    Request Body `form-data`:\r\n\r\n    ```\r\n    name created\r\n    ```\r\n    Response:\r\n\r\n    ```JSON\r\n    [\r\n        \"{ id: 5, name: 'created' }\"\r\n    ]\r\n    ```\r\n\r\n1. **Update Example**\r\n    * Update an Example by ID\r\n        * Docker `PUT http://localhost:5001/api/db/example/1`\r\n        * Standalone `PUT http://localhost:5000/api/db/example/1`\r\n\r\n    Request Body `form-data`:\r\n\r\n    ```\r\n    name updated    \r\n    ```\r\n\r\n    Response:\r\n    ```JSON\r\n    [\r\n        \"{ id: 1, name: 'updated' }\"\r\n    ]\r\n    ```\r\n\r\n1. **Delete Example**\r\n    * Delete an Example by ID\r\n        * Docker `DELETE http://localhost:5001/api/db/example/1`\r\n        * Standalone `DELETE http://localhost:5000/api/db/example/1`\r\n\r\n    Request Body `form-data`:\r\n    ```\r\n    name updated\r\n    ```\r\n    Response:\r\n    ```JSON\r\n    [\r\n        \"{ id: 1, name: 'updated' }\"\r\n    ]\r\n    ```\r\n\r\n## Resources and Links\r\n\r\n1. https://towardsdatascience.com/how-to-insert-dummy-data-into-databases-using-flask-sqlalchemy-9c59efab4527\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fpython_api_2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtscript%2Fpython_api_2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fpython_api_2023/lists"}