How to create Gephi network graphs from Python?

后端 未结 2 1272
我寻月下人不归
我寻月下人不归 2021-02-01 22:33

I have just found out about GephiStreamer. https://pypi.python.org/pypi/GephiStreamer

Using this package one can send instructions from python to Gephi to create nodes a

相关标签:
2条回答
  • 2021-02-01 23:12

    I found this question while looking for the answer myself. I picked Gephi as my visualizer and then wanted to build a graph that was well supported by the tool by pulling data from around my org with Python.

    I found GephiStreamer and it looks a simple yet comprehensive way to build graphs in Gephi from an external python environment (command line, or IDE)

    The other options at this point are:

    • The Gephi Python Scripting Console
    • Any Graph Lib that can export in a Gephi readable format
      • NetworkX
      • python-igraph
      • graph-tool
    • Any of the python GEFX writers (Google "python GEFX")
    0 讨论(0)
  • 2021-02-01 23:16

    There is no simple answer to that. The people at the Facebook group might be knowing something but IMO the best way to do it would be to call the Gephi toolkit, i.e. the available jar, from jython, check here for an example use. The thing is that jython doesn't allow to install numpy and a series of other libraries but I guess you could get around this issue by piping the output of one script to the other or using a queue like Celery.

    So I would write a script let's call it graph_construction.py that uses networkx, construct the graph and then write it in the standard output in gexf. Then I would write a second script, gephi.py that would execute things in gephi and let's say write the graph to a pdf and then do something like:

    python graph_construction.py | jython gephi.py output.pdf
    

    and pray for it to work.

    0 讨论(0)
提交回复
热议问题