Skip to main content

Python package for DocBrown, a temporal graph library

Project description


Raphtory

Test and Build Latest Release Issues Launch Notebook

🌍 Website   📒 Documentation   Pometry   🧙🏻‍ Tutorial   🐛 Report a Bug   Join Slack


Raphtory is a powerful analytics engine for large-scale graph analysis. It lets you run complex queries on your data, no matter where it's stored or what format it's in. But that's not all - Raphtory's real superpower is its ability to track and explore the history of a complex system, from "time traveling" through data to executing advanced analysis like taint tracking, temporal reachability, and mining temporal motifs.

Raphtory is easy to use: just run a single pip install command and embed it with your existing Python/Pandas pipeline for input and output.

Raphtory is expressive: It's designed to represent all types of graph queries and has a well-developed API for exploring your data across its history.

Raphtory is lightning-fast and scales effortlessly: Built on Apache Arrow's storage and vectorized compute, Raphtory can be run on a laptop or a distributed cluster for terabyte-scale graphs.

Running a basic example

# Import Raphtory
import PyRaphtory

# Create a new local or distributed context
ctx = PyRaphtory.local()
graph = ctx.new_graph()

# Add some data to your graph
graph.add_vertex(1, 1)
graph.add_vertex(2, 2)
graph.add_vertex(3, 3)
graph.add_edge(4, 1, 2)
graph.add_edge(4, 1, 3)

# Collect some simple vertex metrics
# Ran across a range of the data with incremental windowing
df = graph
      .range(1,4,1)
      .window(1)
      .step(lambda vertex: vertex.set_state("name", vertex.name()))
      .step(lambda vertex: vertex.set_state("out_degree", vertex.out_degree())) 
      .step(lambda vertex: vertex.set_state("in_degree", vertex.in_degree()))
      .select("name", "out_degree", "in_degree")
      .to_df()

# Preview DataFrame
df

|    |   timestamp |   window |   name |   out_degree |   in_degree |
|----|-------------|----------|--------|--------------|-------------|
|  0 |           1 |        1 |      1 |            0 |           0 |
|  1 |           2 |        1 |      2 |            0 |           0 |
|  2 |           3 |        1 |      3 |            0 |           0 |
|  3 |           4 |        1 |      1 |            2 |           0 |
|  4 |           4 |        1 |      2 |            0 |           1 |
|  5 |           4 |        1 |      3 |            0 |           1 |

Installing Raphtory

Raphtory is available for Python and Scala/Java, with support for Rust planned in version 0.3.0. We recommend using the PyRaphtory client for Python, which includes everything you need and can be run locally or in distributed mode.

You should have Python version 3.9 or higher. It's a good idea to use conda, virtualenv, or pyenv.

pip install pyraphtory

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.

Binder

Want to see what Raphtory can do? Scroll down for more.

1. Getting started

Type Location Description
Example ingestion Loading some sample data into Raphtory
Example degree count Running the simplest graph query in Raphtory
Example timetravel Understanding the time APIs in Raphtory

2. Running some algorithms

Type Location Description
Example centrality Centrality algorithms for finding important nodes
Example community Community detection for finding clusters
Example dynamic Dynamic algorithms and random walks
Example temporal Applying time magic to find historic and future trends

3. Developing an end-to-end application

Type Location Description
Notebook nft_analysis.ipynb Analysing pump and dump cycles of popular NFTs
Notebook ppe_analysis.ipnyb Fraud and COVID-19 Relief Schemes

Want to run your own analysis?

Learn how to use Raphtory in your analysis and project by following these links.

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://www.raphtory.com/algorithm-bounty/ 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!

  • Follow Slack for the latest Raphtory news and development

  • Join our Slack to chat with us and get answers to your questions!

Articles and Talks about Raphtory

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 Apache License (check out our LICENSE file).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

raphtory-0.0.11-cp311-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

raphtory-0.0.11-cp311-cp311-macosx_11_0_arm64.whl (3.1 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

raphtory-0.0.11-cp311-cp311-macosx_10_7_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

raphtory-0.0.11-cp310-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

raphtory-0.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

raphtory-0.0.11-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (5.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

raphtory-0.0.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

raphtory-0.0.11-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

raphtory-0.0.11-cp310-cp310-macosx_10_7_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

raphtory-0.0.11-cp39-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

raphtory-0.0.11-cp38-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

raphtory-0.0.11-cp37-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page