Name | utme JSON |
Version |
1.0.1
JSON |
| download |
home_page | None |
Summary | Universal Turing Machine Emulator. |
upload_time | 2025-08-08 21:26:39 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | None |
keywords |
turing
machine
emulator
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Universal Turing Machine Emulator
=================================
**utme** is a library that provides [*Turing machine*][tm] emulation in pure
Python.
With **utme**, you can define a *Turing machine*, run it with an input and
inspect its output.
> Note: I wrote this library to help myself understand Turing machines.
> **utme** is not suitable for efficient/performant Turing machine emulation.
[tm]: https://en.wikipedia.org/wiki/Turing_machine
### Why is it called *universal*?
As the library allows you to define any valid *Turing machine* (universal or
not) and run it, the library itself is equivalent to a *universal Turing
machine* (a Turing machine that accepts another Turing machine and an input for
it, and yields its output).
While **utme** does not emulate a universal Turing machine by itself, I found
the name cool (It was originally `utm`, but then I found out it was already
taken by another project on [PyPI][pypi]).
That said, there is an [example script](./examples/universal.py) that
composes `universal_machine`; a universal Turing machine using **utme**.
The script also provides `encode`/`decode` functions that converts **utme**
objects from and into valid tapes for `universal_machine` (so you can even pass
`universal_machine` (with an input) to itself!).
[pypi]: https://pypi.org/
Installation
------------
**utme** is available in the [Python Package Index][pypi-utme]:
```sh
pip install utme
```
The library has zero dependencies and should work on any Python (3.12+)
implementation on any platform.
[pypi-utme]: https://pypi.org/project/utme/
Documentation
-------------
**utme**'s API is documented at the definition level (via *docstrings* where
possible, and comments otherwise).
The library code is around 250 logical line of codes, so you can easily read
the source code to understand implementation details.
Exported objects are categorized and enumerated briefly in the package's
*docstring*:
```sh
python -m pydoc utme
```
### Examples
Examples of Turing machines implemented using **utme** are included in the
[examples](./examples) directory.
Development
-----------
You only need [`uv`][uv] and [`just`][just] on your POSIX system to get
started.
Run `just` (without arguments) to see available tasks.
[uv]: https://github.com/astral-sh/uv
[just]: https://github.com/casey/just
### Contribution
Before you submit a patch, please run `just precommit` and make sure the task
runs successfully. Patches that don't pass `just precommit` will not be
merged.
License
-------
**utme** is licensed under the [MIT (Expat) license](./LICENSE).
> Copyright (C) 2025 Karam Assany (karam.assany@disroot.org)
Raw data
{
"_id": null,
"home_page": null,
"name": "utme",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "turing, machine, emulator",
"author": null,
"author_email": "Karam Assany <karam.assany@disroot.org>",
"download_url": "https://files.pythonhosted.org/packages/ab/56/61d3357997803e722074a033cc5b6960a7eb78455c01e70857d1d22b9550/utme-1.0.1.tar.gz",
"platform": null,
"description": "Universal Turing Machine Emulator\n=================================\n\n**utme** is a library that provides [*Turing machine*][tm] emulation in pure\nPython.\n\nWith **utme**, you can define a *Turing machine*, run it with an input and\ninspect its output.\n\n> Note: I wrote this library to help myself understand Turing machines.\n> **utme** is not suitable for efficient/performant Turing machine emulation.\n\n[tm]: https://en.wikipedia.org/wiki/Turing_machine\n\n### Why is it called *universal*?\n\nAs the library allows you to define any valid *Turing machine* (universal or\nnot) and run it, the library itself is equivalent to a *universal Turing\nmachine* (a Turing machine that accepts another Turing machine and an input for\nit, and yields its output).\n\nWhile **utme** does not emulate a universal Turing machine by itself, I found\nthe name cool (It was originally `utm`, but then I found out it was already\ntaken by another project on [PyPI][pypi]).\n\nThat said, there is an [example script](./examples/universal.py) that\ncomposes `universal_machine`; a universal Turing machine using **utme**.\nThe script also provides `encode`/`decode` functions that converts **utme**\nobjects from and into valid tapes for `universal_machine` (so you can even pass\n`universal_machine` (with an input) to itself!).\n\n[pypi]: https://pypi.org/\n\n\nInstallation\n------------\n\n**utme** is available in the [Python Package Index][pypi-utme]:\n\n```sh\npip install utme\n```\n\nThe library has zero dependencies and should work on any Python (3.12+)\nimplementation on any platform.\n\n[pypi-utme]: https://pypi.org/project/utme/\n\n\nDocumentation\n-------------\n\n**utme**'s API is documented at the definition level (via *docstrings* where\npossible, and comments otherwise).\n\nThe library code is around 250 logical line of codes, so you can easily read\nthe source code to understand implementation details.\n\nExported objects are categorized and enumerated briefly in the package's\n*docstring*:\n\n```sh\npython -m pydoc utme\n```\n\n### Examples\n\nExamples of Turing machines implemented using **utme** are included in the\n[examples](./examples) directory.\n\n\nDevelopment\n-----------\n\nYou only need [`uv`][uv] and [`just`][just] on your POSIX system to get\nstarted.\n\nRun `just` (without arguments) to see available tasks.\n\n[uv]: https://github.com/astral-sh/uv\n[just]: https://github.com/casey/just\n\n### Contribution\n\nBefore you submit a patch, please run `just precommit` and make sure the task\nruns successfully. Patches that don't pass `just precommit` will not be\nmerged.\n\n\nLicense\n-------\n\n**utme** is licensed under the [MIT (Expat) license](./LICENSE).\n\n> Copyright (C) 2025 Karam Assany (karam.assany@disroot.org)\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Universal Turing Machine Emulator.",
"version": "1.0.1",
"project_urls": {
"repository": "https://codeberg.org/karam/utme"
},
"split_keywords": [
"turing",
" machine",
" emulator"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "21a4f4b307e2f16d3b8ff0b5dbec0af17b4645d4688876a98ff827912958b5ae",
"md5": "bc365ef32c5712bb595b8ac66c478d84",
"sha256": "1097acbb6170df0180752324224f8813a379655700693900c0d6a9e92d1e65a8"
},
"downloads": -1,
"filename": "utme-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc365ef32c5712bb595b8ac66c478d84",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 9097,
"upload_time": "2025-08-08T21:26:34",
"upload_time_iso_8601": "2025-08-08T21:26:34.880432Z",
"url": "https://files.pythonhosted.org/packages/21/a4/f4b307e2f16d3b8ff0b5dbec0af17b4645d4688876a98ff827912958b5ae/utme-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ab5661d3357997803e722074a033cc5b6960a7eb78455c01e70857d1d22b9550",
"md5": "10cbc05bd33f595647593fec4063ea74",
"sha256": "deddb326f9fd387f1de0cf1be3eba7a76618f8d33858f7f641369b1e3ab7ba0c"
},
"downloads": -1,
"filename": "utme-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "10cbc05bd33f595647593fec4063ea74",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 8110,
"upload_time": "2025-08-08T21:26:39",
"upload_time_iso_8601": "2025-08-08T21:26:39.332773Z",
"url": "https://files.pythonhosted.org/packages/ab/56/61d3357997803e722074a033cc5b6960a7eb78455c01e70857d1d22b9550/utme-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 21:26:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": true,
"codeberg_user": "karam",
"codeberg_project": "utme",
"lcname": "utme"
}