Skip to main content

A library for visualizing semantic-state-machine structures and AuditContext execution paths as graphs using graphable.

Project description

semantic-state-machine-graphable

A library for visualizing semantic-state-machine structures and AuditContext execution paths as graphs using graphable.

Features

  • StateMachineGraph: Visualize the static structure of a semantic-state-machine.StateMachine.
  • AuditContextGraph: Visualize the execution history of an AuditContext as a graph, with edges annotated by transition indices.

Installation

For Development

The project is managed with uv. To install dependencies:

uv sync

From PyPI

pip install semantic-state-machine-graphable

Testing

The project employs a tiered testing strategy:

  • Unit & Integration: Run with pytest.
  • Property-based Fuzzing: Run with pytest tests/hypothesis. These are powered by hypothesis and provide robust edge-case coverage.

Run the full test suite:

uv run pytest tests

Usage

State Machine Visualization

from semantic_state_machine_graphable import StateMachineGraph

graph = StateMachineGraph(sm)
# Export to DOT format
dot_output = graph.to_dot()
print(dot_output)

# To visualize with Graphviz, you can use the command line:
# echo '...' | dot -Tpng -o state_machine.png

Execution Path Visualization

from semantic_state_machine_graphable import AuditContextGraph

graph = AuditContextGraph(ctx, sm)
# Export to DOT format
dot_output = graph.to_dot()
print(dot_output)

# To visualize with Graphviz:
# echo '...' | dot -Tpng -o audit_path.png

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

semantic_state_machine_graphable-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file semantic_state_machine_graphable-0.2.0.tar.gz.

File metadata

File hashes

Hashes for semantic_state_machine_graphable-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ba366ec39d8d460f69674be905b8b43957956604eb042b49e2c36bc7fb60c1b0
MD5 d9c76ede14320642092bb3ca14b7be7d
BLAKE2b-256 683c044f3fe13adfa67c23ff3cdd7973883440243dd47ff3696b24bcef5a8e45

See more details on using hashes here.

Provenance

The following attestation bundles were made for semantic_state_machine_graphable-0.2.0.tar.gz:

Publisher: publish.yml on TheTrueSCU/semantic-state-machine-graphable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file semantic_state_machine_graphable-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for semantic_state_machine_graphable-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc223aec9758467d1de5bd8ce4a795ebddd4d747c434de09e0eadcb7f9ce63dc
MD5 a28a1d6b3df5df1570641ea00e450c40
BLAKE2b-256 e857574a79513d3f2d46a6bb8018d002f8be41e4fae9f72af3f8ec50cb86159b

See more details on using hashes here.

Provenance

The following attestation bundles were made for semantic_state_machine_graphable-0.2.0-py3-none-any.whl:

Publisher: publish.yml on TheTrueSCU/semantic-state-machine-graphable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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