{"id":29430273,"url":"https://github.com/precice/config-graph","last_synced_at":"2026-01-04T11:14:59.173Z","repository":{"id":300197606,"uuid":"1005472754","full_name":"precice/config-graph","owner":"precice","description":"A python library that builds a graph from a preCICE configuration file for validation and visualization purposes.","archived":false,"fork":false,"pushed_at":"2025-07-01T12:02:43.000Z","size":327,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T12:28:56.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/precice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://precice.org/community-support-precice"}},"created_at":"2025-06-20T09:29:38.000Z","updated_at":"2025-07-01T12:02:46.000Z","dependencies_parsed_at":"2025-06-20T11:35:08.234Z","dependency_job_id":null,"html_url":"https://github.com/precice/config-graph","commit_stats":null,"previous_names":["precice/config-graph"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/precice/config-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fconfig-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fconfig-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fconfig-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fconfig-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/precice","download_url":"https://codeload.github.com/precice/config-graph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fconfig-graph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265024860,"owners_count":23699621,"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","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":[],"created_at":"2025-07-12T17:06:23.393Z","updated_at":"2026-01-04T11:14:59.167Z","avatar_url":"https://github.com/precice.png","language":"Python","funding_links":["https://precice.org/community-support-precice"],"categories":[],"sub_categories":[],"readme":"# preCICE Config Graph\n\nA Python library that builds a graph from a preCICE configuration file for validation and visualization purposes\nand enables to recreate a precice-config.xml from it.\n\n**How does this differ from [the preCICE Config-Visualizer](https://github.com/precice/config-visualizer)?** The graph\nbuilt by this library is not (directly) meant to be displayed. The focus is on building a graph that represents the\nstructure of a preCICE configuration in a way that is useful in checking for logical errors.\nThis logic can also be used to generate a precice-config.xml from a given set of nodes.\n\n\u003e [!NOTE]\n\u003e This library assumes the config file to adhere to preCICE conguration-file syntax. For example, references by name are assumed to exist.\n\u003e If the config file passes the preCICE-built-in checks (`precice-tools check` before preCICE version 3.3.0; `precice-config-validate` after preCICE version 3.3.0) without errors, then it is also\n\u003e read correctly by this library. If `precice-config-validate` does not succeed, the behavior of this library is\n\u003e undefined (it will probably crash).\n\n## Requirements\n\n- Python 3.10+\n- Pip\n- Git for cloning the repository\n- PyQt6\n\n## Installation\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/precice/config-graph\ncd config-graph\n```\n\n2. Create a new Python Virtual Environment (optional, but recommended):\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n```\n\n3. Install required dependencies:\n\n```bash\npip install .\n```\n\n## Project Structure\n\n```\nconfig-graph\n├── .github, .idea, etc…\n│\n├── docs                       # Useful information for understanding how this library works\n│   └── …\n│\n├── debugging                  # Utility for debugging graph generation. See section in this README on the topic.\n│   └── cli.py                 # Call this script to visualize a provided config\n│\n├── precice_config_graph       # Main library files\n│   ├── edges.py               # Definition of edge types\n│   ├── graph.py               # Main logic for building the graph from parsed XML\n│   ├── nodes.py               # Definition of node types\n│   ├── enums.py               # Definition enums used for node-creation\n│   └── xml_processing.py      # preCICE-specific utilities for reading XML files correctly\n│\n├── test                       # All files for automated testing\n│   └── example-configs        # Contains sample configurations that are then tested one by one\n│       └── \u003ccase-name\u003e\n│           ├── precice-config.xml\n│           └── test.py        # File that tests the graph that is produced from precice-config.xml for validity\n│\n├── .gitignore, LICENSE, README.md\n│\n├── pyproject.toml             # Project configuration (dependencies etc.)\n└── shell.nix                  # Dependencies for anyone using NixOS / the nix-package manager. Should be replaced by a flake in the future.\n```\n\n## Using in your project\n\nThis library is published to PyPi as `precice-config-graph`.\nIt can be installed via\n\n```bash\npip install precice-config-graph\n```\n\nOtherwise, it can also be imported into your `pyproject.toml` like so:\n\n```toml\n# …\ndependencies = [\n    \"precice_config_graph @ git+https://github.com/precice/config-graph.git\",\n    # …\n]\n# …\n```\n\nThen, run `pip install .` in your project. To build a graph, use the following code snippet:\n\n```python\nfrom precice_config_graph import graph, xml_processing\n\npath = \"./some/path/to/your/precice-config.xml\"\nroot = xml_processing.parse_file(path)\nG = graph.get_graph(root)\n# use, traverse inspect the graph\n\n# to view the graph\ngraph.print_graph(G)\n```\n\n## Debugging graph generation\n\nThis module includes a small utility that helps with debugging the output graph. You can pass a custom\n`precice-config.xml` and it displays the graph it built in a pop-up window.\n\nTo get started, run\n\n```bash\npython debugging/cli.py \"./path-to-your/precice-config.xml\"\n```\n\n## Graph structure\n\nThe types of nodes and edges are documented under `docs/Nodes-and-Edges.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecice%2Fconfig-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprecice%2Fconfig-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecice%2Fconfig-graph/lists"}