Skip to main content

A python framework for formal grammars

Project description


Python package pypi Documentation badge

A python library to manipulate formal grammar. In general, it can be used to better understand algorithms in a formal way.

If you use Pyformlang in your project, please cite our paper:

author="Romero, Julien",
title="Pyformlang: An Educational Library for Formal Language Manipulation",
doi = {}


pip3 install pyformlang


Most algorithms come from Introduction to Automata Theory, Languages, and Computation (2nd edition) by John E. Hopcroft, Rajeev Motwani and Jeferey D. Ullman.

Indexed grammars come from the original paper Index Grammars - An Extension of Context-free grammars by Alfred V. Aho.

On the implementation of Hopcroft minimization algorithm: Implementation of Hopcroft's Algorithm, Hang Zhou

Intersection CFG/Regex and a better written version


Please refer to the official documentation:

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

pyformlang-1.0.10.tar.gz (95.1 kB view hashes)

Uploaded Source

Built Distribution

pyformlang-1.0.10-py3-none-any.whl (126.8 kB view hashes)

Uploaded Python 3

Supported by

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