Education Turing Machine simulator in Python
Project description
[๐ง๐ท] Lรช em portuguรชs
Turing-py
A simple and extensible Turing Machine simulator written in Python, designed for learning, experimentation, and educational purposes.
Install directly from the Python Package Index (PyPI):
pip install turing-py
๐ About
A Turing Machine is an abstract computational model introduced by Alan Turing in 1936. It is widely used in computer science to study the limits of computation and algorithm design.
turing-py provides a Python implementation that enables:
- Simulation of Turing Machines
- Creation of custom transition rules
- Step-by-step computation
- Experimentation with theoretical algorithms
This project is intended for:
- Computer Science students
- Theory of Computation courses
- Developers interested in computational models
- Educational demonstrations
๐ฆ Installation
Install using pip:
pip install turing-py
Or install from source:
git clone https://github.com/ericshantos/turing-py.git
cd turing-py
pip install .
โจ Features
- Deterministic Turing Machine simulation
- Customizable tape input
- Configurable states and transitions
- Step-by-step execution
- Simple and modular Python architecture
- Easy to extend and modify
- CLI-ready structure
๐ Project Structure
turing-py/
โ
โโโ pyproject.toml
โโโ README.md
โโโ LICENSE
โโโ .gitignore
โ
โโโ src/
โโโ tmpy/
โโโ __init__.py
โ
โโโ machine/
โ โโโ __init__.py
โ โโโ turing_machine.py
โ โโโ tape.py
โ โโโ states.py
โ
โโโ alphabet/
โ โโโ __init__.py
โ โโโ symbol.py
โ โโโ alphabet.py
โ โโโ tape_alphabet.py
โ
โโ transition/
โโโ __init__.py
โโโ transition.py
โโโ transition_function.py
โโโ direction.py
๐งช Example Turing Machines
Examples you can implement using turing-py:
- Binary increment machine
- Palindrome checker
- Unary addition
- Even/Odd binary checker
- String copying machine
๐งฉ How It Works
A Turing Machine consists of:
- Tape โ infinite memory divided into cells
- Head โ reads and writes symbols on the tape
- States โ machine configuration states
- Transition Function โ rules that determine the next action
Each step follows this rule:
(Current State, Read Symbol) โ (Next State, Write Symbol, Move Direction)
Where direction can be:
Lโ Move leftRโ Move right
๐ค Contributing
Contributions are welcome!
To contribute:
- Fork the repository
- Create a new branch
git checkout -b feature/my-feature
- Make your changes
- Commit your work
git commit -m "Add new feature"
- Push to your fork
git push origin feature/my-feature
- Open a Pull Request
๐ License
This project is licensed under the MIT License.
๐จโ๐ป Author
Developed by Eric Santos.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file turing_py-2.1.0.tar.gz.
File metadata
- Download URL: turing_py-2.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68be9952a0ddfd42c597f5a16c31420df2915c9716985406ab0f952a6e374134
|
|
| MD5 |
9add8d6803b4e9a1fe9008b2a44559ee
|
|
| BLAKE2b-256 |
e713c613fab43309329e6bdb14cbcdc350c63e221cba4fe204fdd18a83b4d875
|
Provenance
The following attestation bundles were made for turing_py-2.1.0.tar.gz:
Publisher:
python-publish.yml on ericshantos/turing-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turing_py-2.1.0.tar.gz -
Subject digest:
68be9952a0ddfd42c597f5a16c31420df2915c9716985406ab0f952a6e374134 - Sigstore transparency entry: 1097708327
- Sigstore integration time:
-
Permalink:
ericshantos/turing-py@679237e0403b04fe2f0aa718c89dd516e2de0166 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/ericshantos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@679237e0403b04fe2f0aa718c89dd516e2de0166 -
Trigger Event:
push
-
Statement type:
File details
Details for the file turing_py-2.1.0-py3-none-any.whl.
File metadata
- Download URL: turing_py-2.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e9bb853fea347dd194422438cd69691796a4e6a9247b220bb21edb8c3e67dd6
|
|
| MD5 |
a49c184b324b320fcdd1caf82192fb4a
|
|
| BLAKE2b-256 |
30d5c9a2b9ab824f598956ad8be1ed163277202cde3e1b61152202a9de304b75
|
Provenance
The following attestation bundles were made for turing_py-2.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on ericshantos/turing-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turing_py-2.1.0-py3-none-any.whl -
Subject digest:
0e9bb853fea347dd194422438cd69691796a4e6a9247b220bb21edb8c3e67dd6 - Sigstore transparency entry: 1097708332
- Sigstore integration time:
-
Permalink:
ericshantos/turing-py@679237e0403b04fe2f0aa718c89dd516e2de0166 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/ericshantos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@679237e0403b04fe2f0aa718c89dd516e2de0166 -
Trigger Event:
push
-
Statement type: