{"id":30727851,"url":"https://github.com/p0dalirius/bhopengraph","last_synced_at":"2025-09-03T14:49:59.820Z","repository":{"id":309878422,"uuid":"1037833566","full_name":"p0dalirius/bhopengraph","owner":"p0dalirius","description":"A python library to create BloodHound  OpenGraphs","archived":false,"fork":false,"pushed_at":"2025-09-02T14:32:26.000Z","size":254,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T04:42:54.716Z","etag":null,"topics":["bloodhound","library","opengraph","python"],"latest_commit_sha":null,"homepage":"https://bhopengraph.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p0dalirius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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":{"github":"p0dalirius","patreon":"Podalirius"}},"created_at":"2025-08-14T07:33:53.000Z","updated_at":"2025-09-02T16:47:23.000Z","dependencies_parsed_at":"2025-08-14T10:29:02.684Z","dependency_job_id":"2531cac3-5b32-430b-9e9a-3c56be03a8d7","html_url":"https://github.com/p0dalirius/bhopengraph","commit_stats":null,"previous_names":["p0dalirius/bhopengraph"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/p0dalirius/bhopengraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fbhopengraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fbhopengraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fbhopengraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fbhopengraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p0dalirius","download_url":"https://codeload.github.com/p0dalirius/bhopengraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Fbhopengraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273446459,"owners_count":25107159,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bloodhound","library","opengraph","python"],"created_at":"2025-09-03T14:49:59.081Z","updated_at":"2025-09-03T14:49:59.807Z","avatar_url":"https://github.com/p0dalirius.png","language":"Python","funding_links":["https://github.com/sponsors/p0dalirius","https://patreon.com/Podalirius"],"categories":[],"sub_categories":[],"readme":"# bhopengraph: A python library to create BloodHound OpenGraphs \n\n\u003cp align=\"center\"\u003e\n  A python library to create BloodHound OpenGraphs easily\n  \u003cbr\u003e\n  \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/bhopengraph\"\u003e\n  \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/bhopengraph\"\u003e\n  \u003ca href=\"https://twitter.com/intent/follow?screen_name=podalirius_\" title=\"Follow\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/podalirius_?label=Podalirius\u0026style=social\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.youtube.com/c/Podalirius_?sub_confirmation=1\" title=\"Subscribe\"\u003e\u003cimg alt=\"YouTube Channel Subscribers\" src=\"https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social\"\u003e\u003c/a\u003e\n  \u003cimg height=21px src=\"https://img.shields.io/badge/Get bloodhound:-191646\"\u003e \u003ca href=\"https://specterops.io/bloodhound-enterprise/\" title=\"Get BloodHound Enterprise\"\u003e\u003cimg alt=\"Get BloodHound Enterprise\" height=21px src=\"https://mintlify.s3.us-west-1.amazonaws.com/specterops/assets/enterprise-edition-pill-tag.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://specterops.io/bloodhound-community-edition/\" title=\"Get BloodHound Community\"\u003e\u003cimg alt=\"Get BloodHound Community\" height=21px src=\"https://mintlify.s3.us-west-1.amazonaws.com/specterops/assets/community-edition-pill-tag.svg\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n## Features\n\nThis module provides Python classes for creating and managing graph structures that are compatible with BloodHound OpenGraph. The classes follow the [BloodHound OpenGraph schema](https://bloodhound.specterops.io/opengraph/schema) and [best practices](https://bloodhound.specterops.io/opengraph/best-practices).\n\nIf you don't know about BloodHound OpenGraph yet, a great introduction can be found here: [https://bloodhound.specterops.io/opengraph/best-practices](https://bloodhound.specterops.io/opengraph/best-practices)\n\nThe complete documentation of this library can be found here: https://bhopengraph.readthedocs.io/en/latest/ \n\n## Examples\n\nHere is an example of a Python program using the [bhopengraph](https://github.com/p0dalirius/bhopengraph) python library to model the [Minimal Working JSON](https://bloodhound.specterops.io/opengraph/schema#minimal-working-json) from the OpenGraph Schema documentation:\n\n```py\nfrom bhopengraph.OpenGraph import OpenGraph\nfrom bhopengraph.Node import Node\nfrom bhopengraph.Edge import Edge\nfrom bhopengraph.Properties import Properties\n\n# Create an OpenGraph instance\ngraph = OpenGraph(source_kind=\"Base\")\n\n# Create nodes\nbob_node = Node(\n    id=\"123\",\n    kinds=[\"Person\", \"Base\"],\n    properties=Properties(\n        displayname=\"bob\",\n        property=\"a\",\n        objectid=\"123\",\n        name=\"BOB\"\n    )\n)\n\nalice_node = Node(\n    id=\"234\",\n    kinds=[\"Person\", \"Base\"],\n    properties=Properties(\n        displayname=\"alice\",\n        property=\"b\",\n        objectid=\"234\",\n        name=\"ALICE\"\n    )\n)\n\n# Add nodes to graph\ngraph.add_node(bob_node)\ngraph.add_node(alice_node)\n\n# Create edge: Bob knows Alice\nknows_edge = Edge(\n    start_node=alice_node.id,\n    end_node=bob_node.id,\n    kind=\"Knows\"\n)\n\n# Add edge to graph\ngraph.add_edge(knows_edge)\n\n# Export to file\ngraph.export_to_file(\"minimal_example.json\")\n```\n\nThis gives us the following [Minimal Working JSON](https://bloodhound.specterops.io/opengraph/schema#minimal-working-json) as per the documentation:\n\n```json\n{\n  \"graph\": {\n    \"nodes\": [\n      {\n        \"id\": \"123\",\n        \"kinds\": [\n          \"Person\",\n          \"Base\"\n        ],\n        \"properties\": {\n          \"displayname\": \"bob\",\n          \"property\": \"a\",\n          \"objectid\": \"123\",\n          \"name\": \"BOB\"\n        }\n      },\n      {\n        \"id\": \"234\",\n        \"kinds\": [\n          \"Person\",\n          \"Base\"\n        ],\n        \"properties\": {\n          \"displayname\": \"alice\",\n          \"property\": \"b\",\n          \"objectid\": \"234\",\n          \"name\": \"ALICE\"\n        }\n      }\n    ],\n    \"edges\": [\n      {\n        \"kind\": \"Knows\",\n        \"start\": {\n          \"value\": \"123\",\n          \"match_by\": \"id\"\n        },\n        \"end\": {\n          \"value\": \"234\",\n          \"match_by\": \"id\"\n        }\n      }\n    ]\n  },\n  \"metadata\": {\n    \"source_kind\": \"Base\"\n  }\n}\n```\n\n## Contributing\n\nPull requests are welcome. Feel free to open an issue if you want to add other features.\n\n## References\n\n- [BloodHound OpenGraph Best Practices](https://bloodhound.specterops.io/opengraph/best-practices)\n- [BloodHound OpenGraph Schema](https://bloodhound.specterops.io/opengraph/schema)\n- [BloodHound OpenGraph API](https://bloodhound.specterops.io/opengraph/api)\n- [BloodHound OpenGraph Custom Icons](https://bloodhound.specterops.io/opengraph/custom-icons)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Fbhopengraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp0dalirius%2Fbhopengraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Fbhopengraph/lists"}