{"id":32048109,"url":"https://github.com/gephi/gephipy","last_synced_at":"2026-06-20T23:31:24.572Z","repository":{"id":311007500,"uuid":"1042097196","full_name":"gephi/gephipy","owner":"gephi","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-27T20:02:40.000Z","size":175,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-30T08:55:55.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"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/gephi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-21T13:32:09.000Z","updated_at":"2025-10-04T01:31:24.000Z","dependencies_parsed_at":"2025-08-21T15:56:03.113Z","dependency_job_id":"dfa92c14-bd1d-4df0-bc84-31bd9c167176","html_url":"https://github.com/gephi/gephipy","commit_stats":null,"previous_names":["gephi/gephipy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gephi/gephipy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gephi%2Fgephipy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gephi%2Fgephipy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gephi%2Fgephipy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gephi%2Fgephipy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gephi","download_url":"https://codeload.github.com/gephi/gephipy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gephi%2Fgephipy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34589204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":[],"created_at":"2025-10-18T00:41:32.055Z","updated_at":"2026-06-20T23:31:24.567Z","avatar_url":"https://github.com/gephi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":" # Gephipy\n\nThis project is Python wrapper of [Gephi toolkit](https://gephi.org/toolkit/), thanks to [Jpype](https://www.jpype.org) which does the bindings between Java and Python.\n\nIt provides helpers to easy the use of Gephy toolkit for Pythonist, even if you still need to know the Java API.\n\n## Why this project\n\nThis project can be especially useful in Jupyter notebooks to export your graphs in SVG, PDF, or PNG formats. While algorithms and computations can be handled with [NetworkX](https://networkx.org), it lacks the high-quality rendering capabilities needed for publication, which Gephi has and is designed for. \n\nMoreover, it allows you to create a Gephi pipeline, which is useful when you need to generate the same type of map multiple times but with different data.\n \n\n## How to use \n\n* Install the lib `pip install gephipy`\n\n* Import gephipy\n\n```python\nfrom gephipy import gephipy\n\n```\n\nThen you can use the Gephi toolkit or the GephiPy features.\n\n## Example \n\n```python\nfrom gephipy import gephipy\n\n# Java imports must be after the gephipy import\nfrom org.gephi.layout.plugin.forceAtlas2 import ForceAtlas2Builder\nfrom org.gephi.layout.plugin.random import Random\nfrom org.gephi.layout.plugin.noverlap import NoverlapLayoutBuilder\nfrom org.gephi.statistics.plugin import Modularity, GraphDistance\nfrom org.openide.util import Lookup\nfrom org.gephi.appearance.api import AppearanceController\nfrom org.gephi.appearance.plugin import RankingNodeSizeTransformer, PartitionElementColorTransformer\nfrom org.gephi.appearance.plugin.palette import PaletteManager\nfrom org.gephi.statistics.plugin import GraphDistance, Modularity\n\n#\n# Create a workspace\n#\nworkspace = gephipy.create_workspace()\n\n#\n# Import a GEXF file\n#\ngephipy.import_gexf(workspace, \"./graph.gexf\")\ngraphModel = gephipy.get_graph_model(workspace)\n\n#\n# Compute some metrics\n#\n\n# Louvain\nmodularity = Modularity()\nmodularity.execute(graphModel)\n\n# Betweeness centrality\ncentrality = GraphDistance()\ncentrality.setDirected(True)\ncentrality.execute(graphModel)\n\n#\n# Apply appearance\n# Here it is really looks like java code\n#\n\nappearanceController = Lookup.getDefault().lookup(AppearanceController)\nappearanceModel = appearanceController.getModel()\n\n# Size Make node size based on centrality\ncentralityColumn = graphModel.getNodeTable().getColumn(GraphDistance.BETWEENNESS)\ncentralityRanking = appearanceModel.getNodeFunction(centralityColumn, RankingNodeSizeTransformer)\ncentralityTransformer = centralityRanking.getTransformer()\ncentralityTransformer.setMinSize(10)\ncentralityTransformer.setMaxSize(100)\nappearanceController.transform(centralityRanking)\n\n\n# Color by community\ncommunityColumn = graphModel.getNodeTable().getColumn(Modularity.MODULARITY_CLASS)\ncolorPartition = appearanceModel.getNodeFunction(communityColumn, PartitionElementColorTransformer)\npartition = colorPartition.getPartition()\npalette = PaletteManager.getInstance().generatePalette(partition.size(graphModel.getGraph()))\npartition.setColors(graphModel.getGraph(), palette.getColors())\nappearanceController.transform(colorPartition)\n\n\n#\n# Run Layouts\n#\n\n# Random layout\nrandom = Random().buildLayout()\nrandom.setGraphModel(gephipy.get_graph_model(workspace))\nrandom.initAlgo();\nrandom.goAlgo()\nrandom.endAlgo();\n\n# FA2 layout\nfa2 = ForceAtlas2Builder().buildLayout()\nfa2.setGraphModel(gephipy.get_graph_model(workspace))\nfa2.resetPropertiesValues();\nfa2.initAlgo();\nfor x in range(1000):\n  fa2.goAlgo()\n\n# Noverlap layout\nnoverlap = NoverlapLayoutBuilder().buildLayout()\nnoverlap.setGraphModel(gephipy.get_graph_model(workspace))\nnoverlap.initAlgo()\nnoverlap.endAlgo()\n\n#\n# Export your graph\n#\n\ngephipy.export_gexf(workspace, \"my-gephi-graph.gexf\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgephi%2Fgephipy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgephi%2Fgephipy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgephi%2Fgephipy/lists"}