{"id":35849426,"url":"https://github.com/whitemech/pythomata","last_synced_at":"2026-01-08T07:01:05.240Z","repository":{"id":39977689,"uuid":"125121467","full_name":"whitemech/pythomata","owner":"whitemech","description":"A Python package for automata theory.","archived":false,"fork":false,"pushed_at":"2024-01-17T12:40:23.000Z","size":6361,"stargazers_count":57,"open_issues_count":14,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T08:02:15.604Z","etag":null,"topics":["automata","automata-theory","automaton","deterministic-finite-automata","determinizer","dfa","dfa-construction","dfa-minimization","dfa-minimizer","languages-and-automata","nfa","nfa2dfa","nondeterministic-finite-automata","symbolic","symbolic-automata"],"latest_commit_sha":null,"homepage":"https://whitemech.github.io/pythomata/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whitemech.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-13T22:14:54.000Z","updated_at":"2025-09-10T03:59:58.000Z","dependencies_parsed_at":"2024-06-21T13:14:23.822Z","dependency_job_id":"f5ee3ae9-f2fa-403a-a9b8-075a698a515f","html_url":"https://github.com/whitemech/pythomata","commit_stats":{"total_commits":203,"total_committers":3,"mean_commits":67.66666666666667,"dds":0.06896551724137934,"last_synced_commit":"c2960288414de03f429731a6d72b6cadb846da0a"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/whitemech/pythomata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Fpythomata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Fpythomata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Fpythomata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Fpythomata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitemech","download_url":"https://codeload.github.com/whitemech/pythomata/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Fpythomata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28242440,"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","status":"online","status_checked_at":"2026-01-08T02:00:06.591Z","response_time":241,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automata","automata-theory","automaton","deterministic-finite-automata","determinizer","dfa","dfa-construction","dfa-minimization","dfa-minimizer","languages-and-automata","nfa","nfa2dfa","nondeterministic-finite-automata","symbolic","symbolic-automata"],"created_at":"2026-01-08T07:00:21.217Z","updated_at":"2026-01-08T07:01:05.232Z","avatar_url":"https://github.com/whitemech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pythomata\n\n\n[![](https://img.shields.io/pypi/v/pythomata.svg)](https://pypi.python.org/pypi/pythomata)\n[![](https://img.shields.io/travis/whitemech/pythomata.svg)](https://travis-ci.org/whitemech/pythomata)\n[![](https://img.shields.io/pypi/pyversions/pythomata.svg)](https://pypi.python.org/pypi/pythomata)\n[![](https://img.shields.io/badge/docs-mkdocs-9cf)](https://www.mkdocs.org/)\n[![](https://img.shields.io/badge/status-development-orange.svg)](https://img.shields.io/badge/status-development-orange.svg)\n[![codecov](https://codecov.io/gh/whitemech/pythomata/branch/master/graph/badge.svg)](https://codecov.io/gh/whitemech/pythomata)\n[![](https://img.shields.io/badge/flake8-checked-blueviolet)](https://img.shields.io/badge/flake8-checked-blueviolet)\n[![](https://img.shields.io/badge/mypy-checked-blue)](https://img.shields.io/badge/mypy-checked-blue)\n[![](https://img.shields.io/badge/license-LGPLv3%2B-blue)](./LICENSE)\n\nPython implementation of automata theory.\n\n## Links\n\n- GitHub: [https://github.com/whitemech/pythomata](https://github.com/whitemech/pythomata)\n- PyPI: [https://pypi.org/project/pythomata/](https://pypi.org/project/pythomata/)\n- Documentation: [https://whitemech.github.io/pythomata](https://whitemech.github.io/pythomata)\n- Changelog: [https://whitemech.github.io/pythomata/release-history/](https://whitemech.github.io/pythomata/release-history/)\n- Issue Tracker:[https://github.com/whitemech/pythomata/issues](https://github.com/whitemech/pythomata/issues)\n- Download: [https://pypi.org/project/pythomata/#files](https://pypi.org/project/pythomata/#files)\n\n\n## Install\n\n- from [PyPI](https://pypi.org/project/pythomata/):\n```\npip install pythomata\n```\n- or, from source (e.g. `develop` branch):\n```\npip install git+https://github.com/whitemech/pythomata.git@develop\n```\n\n- or, clone the repository and install:\n```\ngit clone https://github.com/whitemech/pythomata.git\ncd pythomata\npip install .\n```\n\n## How to use\n\n* Define an automaton:\n\n```python\nfrom pythomata import SimpleDFA\nalphabet = {\"a\", \"b\", \"c\"}\nstates = {\"s1\", \"s2\", \"s3\"}\ninitial_state = \"s1\"\naccepting_states = {\"s3\"}\ntransition_function = {\n    \"s1\": {\n        \"b\" : \"s1\",\n        \"a\" : \"s2\"\n    },\n    \"s2\": {\n        \"a\" : \"s2\",\n        \"b\" : \"s1\",\n        \"c\" : \"s3\",\n    },\n    \"s3\":{\n        \"c\" : \"s3\"\n    }\n}\ndfa = SimpleDFA(states, alphabet, initial_state, accepting_states, transition_function)\n```\n\n* Test word acceptance:\n\n```python\n# a word is a list of symbols\nword = \"bbbac\"\ndfa.accepts(word)        # True\n\n# without the last symbol c, the final state is not reached\ndfa.accepts(word[:-1])   # False\n```\n\n* Operations such as minimization and trimming:\n\n```python\ndfa_minimized = dfa.minimize()\ndfa_trimmed = dfa.trim()\n```\n\n* Translate into a [`graphviz.Digraph`](https://graphviz.readthedocs.io/en/stable/api.html#graphviz.Digraph)\n  instance:\n\n```python\ngraph = dfa.minimize().trim().to_graphviz()\n```\n\nTo print the automaton:\n```python\ngraph.render(\"path_to_file\")\n```\n\nFor that you will need to install Graphviz.\nPlease look at their [download page](https://graphviz.gitlab.io/download/)\nfor detailed instructions depending on your system.\n\nThe output looks like the following:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"150\" height=\"300\" src=\"./images/my_awesome_automaton.svg\" /\u003e\n\u003c/p\u003e\n\n\n## Features\n\n\n* Basic DFA and NFA support;\n* Algorithms for DFA minimization and trimming;\n* Algorithm for NFA determinization;\n* Translate automata into Graphviz objects.\n* Support for Symbolic Automata.\n\n\n## Tests\n\nTo run the tests:\n```\ntox\n```\nTo run only the code style checks:\n```\ntox -e flake8 -e mypy\n```\n## Docs\n\nTo build the docs:\n\n```\nmkdocs build\n```\n\nTo view documentation in a browser\n\n```\nmkdocs serve\n```\n\nand then go to [http://localhost:8000](http://localhost:8000)\n\n\n## License\n\nPythomata is released under the GNU Lesser General Public License v3.0 or later (LGPLv3+).\n\nCopyright 2018-2020 [WhiteMech](https://whitemech.github.io)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemech%2Fpythomata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitemech%2Fpythomata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemech%2Fpythomata/lists"}