git co
Raphtory is an in-memory graph tool written in Rust with friendly Python APIs on top. It is blazingly fast, scales to hundreds of millions of edges
on your laptop, and can be dropped into your existing pipelines with a simple pip install raphtory
.
It supports time traveling, multilayer modelling, and advanced analytics beyond simple querying like community evolution, dynamic scoring, and mining temporal motifs.
If you wish to contribute, check out the open list of issues, bounty board or hit us up directly on slack. Successful contributions will be reward with swizzling swag!
Running a basic example
# Create a new graph
=
# Add some data to your graph
# Check the number of unique nodes/edges in the graph and earliest/latest time seen.
=
# Collect some simple vertex metrics Ran across the history of your graph with a rolling window
# Print the results
# Grab an edge, explore the history of its 'weight'
=
=
# Compare this weight between time 2 and time 3
= -
# Run pagerank and ask for the top ranked node
=
Graph(number_of_edges=2, number_of_vertices=3, earliest_time=1, latest_time=3)
| | earliest_time | name | out_degree | in_degree |
|---|---------------|---------|------------|-----------|
| 0 | 1 | Alice | 0 | 0 |
| 1 | 1 | Bob | 0 | 0 |
| 2 | 1 | Charlie | 0 | 0 |
| 3 | 2 | Bob | 1 | 0 |
| 4 | 2 | Charlie | 0 | 1 |
| 5 | 3 | Alice | 1 | 0 |
| 6 | 3 | Bob | 1 | 1 |
| 7 | 3 | Charlie | 0 | 1 |
The edge between Bob and Charlie has the following weight history: [(2, 5.0), (3, -15.0)]
The weight of the edge between Bob and Charlie has changed by 20.0 pts
The top node in the graph is Charlie with a score of 0.4744116163405977
GraphQL
Create/Load a graph
Save a raphtory graph and set the GRAPH_DIRECTORY
environment variable to point to the directory containing the graph.
&&
Run the GraphQL server
The code below will run GraphQL with a UI at localhost:1736
GraphlQL will look for graph files in /tmp/graphs
or in the path set in the GRAPH_DIRECTORY
Environment variable.
&&
) )
)
Execute a query
Go to the Playground at http://localhost:1736
and execute the following commands:
Query:
{
) {
}
}
)
Query Variables:
{
}
Expected Result:
{
Installing Raphtory
Raphtory is available for Python and Rust as of version 0.3.0. You should have Python version 3.10 or higher and it's a good idea to use conda, virtualenv, or pyenv.
Examples and Notebooks
Check out Raphtory in action with our interactive Jupyter Notebook! Just click the badge below to launch a Raphtory sandbox online, no installation needed.
Want to give Raphtory a go on your laptop? You can checkout out the latest documentation and complete list of available algorithms or hop on our notebook based tutorials below!
Getting started
Type | Description |
---|---|
Tutorial | Building your first graph |
Developing an end-to-end application
Type | Description |
---|---|
Notebook | Use our powerful time APIs to find pump and dump scams in popular NFTs |
Benchmarks
We host a page which triggers and saves the result of two benchmarks upon every push to the master branch.
View this here https://pometry.github.io/Raphtory/dev/bench/
Bounty board
Raphtory is currently offering rewards for contributions, such as new features or algorithms. Contributors will receive swag and prizes!
To get started, check out our list of desired algorithms at https://github.com/Raphtory/Raphtory/discussions/categories/bounty-board which include some low hanging fruit (🍇) that are easy to implement.
Community
Join the growing community of open-source enthusiasts using Raphtory to power their graph analysis projects!
Contributors
Want to get involved? Please join the Raphtory Slack group and speak with us on how you could pitch in!
License
Raphtory is licensed under the terms of the GNU General Public License v3.0 (check out our LICENSE file).