Skip to main content

A powerful, modern, and educational Python toolkit for automata theory. Visualize DFAs, NFAs, CFGs, PDAs, and Turing machines (single/multi-tape/multi-head); minimize automata; CYK and CFG algorithms; and more with an elegant, type-safe API.

Project description

Automata Diags

PyPI version Python versions License: MIT Documentation Status

A powerful, modern, and educational Python toolkit for automata theory. Visualize DFAs, NFAs, CFGs, minimize automata, and more with an elegant, type-safe API.

For the full, comprehensive documentation including tutorials and the API reference, please visit our Documentation Website.

Installation

pip install automata-diags

Requires Python 3.8+ and Graphviz.

Quick Start

from automata.backend.grammar.dist import State, Symbol
from automata.backend.grammar.regular_languages.dfa.dfa_mod import DFA
from automata.backend.drawings.automata_drawer import AutomataDrawer

# Create a simple DFA
# For more creation methods, see the full documentation.
dfa = DFA.from_string("q0,a,q1;q1,b,q2", start_state="q0", accept_states={"q2"})

# Test it
dfa.accepts([Symbol('a'), Symbol('b')]) # True

# Visualize it
drawer = AutomataDrawer()
drawer.draw_dfa_from_object(dfa, "my_first_dfa")

For more examples and detailed guides, please visit the Full Documentation Site.

Contributing

Contributions are welcome! Please feel free to open a pull request or submit an issue on our GitHub repository.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

automata_diags-0.2.6.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

automata_diags-0.2.6-py3-none-any.whl (46.8 kB view details)

Uploaded Python 3

File details

Details for the file automata_diags-0.2.6.tar.gz.

File metadata

  • Download URL: automata_diags-0.2.6.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for automata_diags-0.2.6.tar.gz
Algorithm Hash digest
SHA256 fa88248aa1cf11a50a5810380265fe10e09b83d2d7f2896b27a0b38313f41872
MD5 65d5053914e906d35c61e06d03ac2756
BLAKE2b-256 aa7195ac509c3618fb4cfe673f2c569170c88493fceb6b549a3f4faff9581193

See more details on using hashes here.

File details

Details for the file automata_diags-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: automata_diags-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for automata_diags-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 eee627042ac307f800e211951192e04dc36b17d88308c2ba033aa7241402f43e
MD5 fe989074170eee5a72a1c8f65b044be3
BLAKE2b-256 64c76f99acdc8f22aef3ebce0b7412fc6a359330ab6b0a3c079239a198b4f9ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page