Skip to main content

NeoGrammarGraph

Python Version BuildStatus Coverage Status Dependencies Code style: black

Creating graphs from context-free grammars for fun and profit.

This project is a re-implementation of GrammarGraph based on the efficient graph-tool library.

Supported Features

  • Creating sub graphs
  • Filter abstraction
  • Reachability of grammar symbols.
  • Computing the shortest path or all paths between two grammar symbols.
  • Computing k-paths (paths of exactly length k) in grammars and derivation trees (see this paper).
  • Checking whether a (sub) graph represents a tree
  • Export to GraphViz DOT files.

Install

NeoGrammarGraph requires at least Python 3.10 and a working installation of graph-tool. We refer to the graph-tool homepage (https://graph-tool.skewed.de/) for instructions on how to obtain graph-tool. On a MacOS system, we recommend the installation using homebrew; on Debian/Ubuntu, there's a custom APT repository to be used with apt-get.

We recommend installing NeoGrammarGraph in a virtual environment. Example usage (inside project directory):

python3.10 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run tests
python3 -m pytest

On MacOS (maybe also on other systems), it might be required to link the graph-tool library into the virtual environment. If you used homebrew to install graph-tool, an example command-line invocation could look as follows (you might have to update some paths depending on the Python/graph-tool versions on your system):

ln -s \
    /usr/local/Cellar/graph-tool/2.51/lib/python3.11/site-packages/graph_tool \
    venv/lib/python3.10/site-packages

For the GitHub workflow, the following line was required:

sudo ln -s \
    /usr/lib/python3/dist-packages/graph_tool \
    /opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages

Author: Dominic Steinhöfel.

Metadata

Release files for neo-grammar-graph 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neo-grammar-graph 0.2.3
File Size Uploaded Provenance
neo_grammar_graph-0.2.3.tar.gz 59.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for neo-grammar-graph 0.2.3
File Interpreter ABI Platform
neo_grammar_graph-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 104.3 kB

Release files / neo_grammar_graph-0.2.3.tar.gz

Download URL neo_grammar_graph-0.2.3.tar.gz
Size 59.0 kB
Tags Source
SHA-256 checksum
How to use checksums
37ba0b8c325613cabfbab87a8fd9d042fa863d3421461a5e04e1b5ceb00b339b
BLAKE2b-256 checksum
How to use checksums
f9a8e52d99e306ff9a79147f6a955bce08a1e99fb3af30c93091501594462810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / neo_grammar_graph-0.2.3-py3-none-any.whl

Download URL neo_grammar_graph-0.2.3-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e46ee26afc6b76d339d6ba0ab8ea7227d42cf88129f95afe0bc90fc7bbadb4a9
BLAKE2b-256 checksum
How to use checksums
5c44e155fe3cc9cc602430ed6b4a94cf6adea5f03ca25a5bf0df5da6bf5d8310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Security for neo-grammar-graph 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page