Python package to build and manipulate dynamic NetworkX graphs.
Project description
Python package to build and manipulate temporal graphs using NetworkX as backend.
Requirements
- Python>=3.7
- networkx>=2.1
- pandas>=1.1.0
Install
Package is available to install on PyPI:
$ pip install 'networkx-temporal[draw]'
The
[draw]
extra includesmatplotlib
, required to plot graphs as in the example below.
Quick example
For detailed information on using the package, please refer to its official documentation.
An interactive Jupyter notebook with more examples is also available here (open on Colab).
>>> import networkx_temporal as tx
>>>
>>> # Build directed temporal graph.
>>> TG = tx.TemporalDiGraph()
>>> TG.add_edge("a", "b", time=0)
>>> TG.add_edge("c", "b", time=1)
>>> TG.add_edge("d", "c", time=2)
>>> TG.add_edge("d", "e", time=2)
>>> TG.add_edge("a", "c", time=2)
>>> TG.add_edge("f", "e", time=3)
>>> TG.add_edge("f", "a", time=3)
>>> TG.add_edge("f", "b", time=3)
>>>
>>> # Slice it into snapshots.
>>> TG = TG.slice(attr="time")
>>>
>>> # Plot resulting object.
>>> tx.draw(TG, layout="kamada_kawai", figsize=(8,2))
Contributing
Contributions are welcome! If you find any bugs or have any suggestions, feel free to open a ticket, fork the repository and create a pull request, or simply send an e-mail. Please keep in mind that any out-of-scope contributions (not regarding temporal networks) should instead be directed to the NetworkX repository.
License
This package is released under the MIT License.
Cite
In case this package is useful for your research, please kindly consider citing it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for networkx_temporal-1.0b17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f92bbfb635a6d8e57db0c826cd6bbf36aa96f4d30d4257b6a32eb0a1768abc |
|
MD5 | 71271335af9b3a16b7752d709c34b8a5 |
|
BLAKE2b-256 | cc0c7199a3626a900ba4086cdb942699beb87ae48a9d8cca7fcdde6b1671d5fc |