{"id":41258230,"url":"https://github.com/kdevo/grapresso","last_synced_at":"2026-01-23T01:55:07.111Z","repository":{"id":57435924,"uuid":"226186252","full_name":"kdevo/grapresso","owner":"kdevo","description":"Graph + Espresso = Caffeinated Python graph data structure library!","archived":false,"fork":false,"pushed_at":"2021-01-27T16:08:23.000Z","size":237,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T18:11:19.125Z","etag":null,"topics":["algorithms","backends","graph-algorithms","graph-theory","graphs","storage-format"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdevo.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}},"created_at":"2019-12-05T20:46:47.000Z","updated_at":"2020-07-21T07:37:00.000Z","dependencies_parsed_at":"2022-09-01T18:43:10.243Z","dependency_job_id":null,"html_url":"https://github.com/kdevo/grapresso","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kdevo/grapresso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdevo%2Fgrapresso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdevo%2Fgrapresso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdevo%2Fgrapresso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdevo%2Fgrapresso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdevo","download_url":"https://codeload.github.com/kdevo/grapresso/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdevo%2Fgrapresso/sbom","scorecard":{"id":553114,"data":{"date":"2025-08-11","repo":{"name":"github.com/kdevo/grapresso","commit":"f63212135686488a2cfa330cb52f482ab5443fba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/kdevo/grapresso/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kdevo/grapresso/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/kdevo/grapresso/publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .travis/integration-tests.sh:7","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:18","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T11:29:45.128Z","repository_id":57435924,"created_at":"2025-08-20T11:29:45.128Z","updated_at":"2025-08-20T11:29:45.128Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithms","backends","graph-algorithms","graph-theory","graphs","storage-format"],"created_at":"2026-01-23T01:55:07.046Z","updated_at":"2026-01-23T01:55:07.099Z","avatar_url":"https://github.com/kdevo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://git.io/grapresso\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Grapresso Logo\" src=\"https://raw.githubusercontent.com/kdevo/grapresso/master/.github/logo.png\" width=\"512\" width=\"64\"\u003e\n\u003c/a\u003e\n\n\n---\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://travis-ci.org/kdevo/grapresso\" target=\"_blank\"\u003e\n        \u003cimg alt=\"Travis CI Build Status\" src=\"https://img.shields.io/travis/kdevo/grapresso?style=flat\u0026color=6f4e37\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/grapresso/\" target=\"_blank\"\u003e\n        \u003cimg alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/grapresso?color=6f4e37\u0026style=flat\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/grapresso/\" target=\"_blank\"\u003e\n        \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/grapresso?color=6f4e37\u0026style=flat\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\nCaffeinated object-oriented Python graph data structure library [originated from an academical context](#Development).\n \n**Grapresso** ☕ is like a good espresso among other graph libs:\n\n- **Quickly consumed**: Easy-to-learn and setup - [just try it](#Usage)!\n- **Different flavours**: Suit up your [backend of choice](#Backends)\n- **Beans are first class**: Object-oriented approach with nodes as first [*class citizens*](https://github.com/kdevo/grapresso/blob/master/grapresso/components/node.py#L7)\n- **Make your Macchiato**: Extensible by design\n- **Concentrated**: [Clear and concise *algorithms*](https://github.com/kdevo/grapresso/blob/master/grapresso/components/graph.py#L117)\n- **Well tested ingredients**: [Integration-tested](https://github.com/kdevo/grapresso-it) using *huge* graphs\n- **Clean and lightweight**: Written in pure *Python 3*, \n[no other libraries needed](https://github.com/kdevo/grapresso/blob/master/setup.py#L25) \n\nGrapresso works wonderfully with PyPy and is up to [up to 4x faster than your regular Python](https://travis-ci.org/github/kdevo/grapresso/builds/704782062). ⚡ \n \n\u003e This project is in an early state. There are many popular algorithms that are **not** yet implemented (at least natively, read below) \n\u003e Feel free to contribute! Make it feel like home for your own graph algorithms. \n\n\n## Goals \n### Grapresso vs. alternatives\n\nThere are many other good graph/network theory libraries. \nThe most popular Python one is probably [NetworkX](https://networkx.github.io/).\n\nFrom an algorithmic perspective, Grapresso will never be able to beat this extremely versatile library with a long history.\nInstead, it follows a different philosophy and aims to be...\n1. *Object-oriented* \n[instead of using dicts for everything](https://networkx.github.io/documentation/stable/reference/introduction.html#data-structure)\n2. *Abstracted and modular* through separation of concerns\n3. Finally, a *meta library* to handle other libraries via backends \n\n\u003e 💡 To fully demonstrate the power of abstraction, Grapresso can be used as a middleman for NetworkX.\n \n## Usage\n\nInstall from PyPI, for instance via pip (needs Python \u003e= 3.6):\n\n```shell\npip install grapresso\n```\n\nWant to get the cheapest tour (round-trip) for [TSP](https://en.wikipedia.org/wiki/Travelling_salesman_problem)? Usage is easy:\n\n```python\nfrom grapresso import Graph\n\n# Build a fully connected graph using InMemoryBackend (default if no backend is given):\ngraph = Graph() \\\n    .add_edge(\"Aachen\", \"Amsterdam\", cost=230) \\\n    .add_edge(\"Amsterdam\", \"Brussels\", cost=200) \\\n    .add_edge(\"Brussels\", \"Aachen\", cost=142)\n\n# Now also add Luxembourg - note that every city needs to be connected to it for the graph to stay fully connected:\nfor city, dist in zip((\"Aachen\", \"Brussels\", \"Amsterdam\"), (200, 212, 420)):\n    graph.add_edge(city, \"Luxembourg\", cost=dist)\n\ntour = graph.cheapest_tour(\"Aachen\")\nassert tour.cost == 842\nprint(tour)\n```\n\nNow, printing to console is not really visually appealing, is it?\nLet's install a backend plugin \n[as an extra](https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies) \nthat is also capable of drawing the graph:\n\n```shell\npip install grapresso[backend-networkx]\n```\n\nLet's quickly draw our previous graph by first converting it to one that uses NetworkX in the background \nand then utilizing NetworkX's natural drawing capabilities:\n\n```python\nfrom grapresso.backends import NetworkXBackend\n\nnx_graph = graph.copy_to(Graph(NetworkXBackend(directed=False)))\nnx_graph.backend.quick_draw(\n    # Map ISO codes to the nodes so that the text fits in the boundaries:\n    labels={'Aachen': 'AC', 'Amsterdam': 'AMS', 'Brussels': 'BR', 'Luxembourg': 'LUX'},\n    # Show cost as label:\n    edge_label_selector='cost',\n    # Mark edges that are actually in the tour\n    mark_edges=tour.edges,\n)\n```\n\nThe resulting image:\n\n![Plotted graph using NetworkX backend](.github/tsp.png)\n\nSee [tests directory](tests) for more examples and also have a look at the \n[integration tests](https://github.com/kdevo/grapresso-it/blob/master/tests/perf/test_algorithm_integration.py)!\n\n## Architecture\n\nGrapresso provides a clean API so that you can easily extend it to store the graph's structure in your preferred storage format.\nAlgorithms are implemented completely independent from the backend.\n\n### Backends\nAlgorithms are performed on a so called \"backend\" which wraps the graph's internal data structure.\n\nThe API is defined in [backend/api.py](grapresso/backends/api.py). Therewith, backends can easily be added provided that they carefully implement the defined API.\n\n#### Implementations\nImplementation                                           | Type                                                  | Underlying data structure                                            | Plugin installation \n-------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------- | ------\n[InMemoryBackend](/grapresso/backends/memory.py)          | In-Memory with Traits                                 | `{node_name: obj}` with obj containing edges                        | Built-in \n[NetworkXBackend](/grapresso/backends/networkx.py)        | [NetworkX](https://networkx.github.io/) compatible    | nx.DiGraph with custom NetworkXNode/-Edge                           | `pip install grapresso[backend-networkx]`\n\n## Development\n\nThis project has been originated in the subject *Mathematical Methods for Computer Science* (translated from the German \"Mathematische Methoden der Informatik\", abbreviated **MMI**) \nin the study programme Information Systems Engineering (ISE) at the FH Aachen.\n\n### Contributing\n\nContributions are welcome, as long as the three [goals](#Goals) are followed.\n\nOtherwise, you can simply support this project by hitting the ![GitHub stars](https://img.shields.io/github/stars/kdevo/grapresso?style=social) button.\nThanks!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdevo%2Fgrapresso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdevo%2Fgrapresso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdevo%2Fgrapresso/lists"}