A data-oriented toolkit for graph data
Project description
A data-oriented toolkit for graph data
versioned graphs + streams + query using Python + GraphQL
Description
Zef is an open source, data-oriented toolkit for graph data. It combines the access speed and local development experience of an in-memory data structure with the power of a fully versioned, immutable database (and distributed persistence if needed with ZefHub). Furthermore, Zef includes a library of composable functional operators, effects handling, and native GraphQL support. You can pick and choose what you need for your project.
If any of these apply to you, Zef might help:
- I need a graph database with fast query speeds and hassle-free infra
- I need a graph data model that's more powerful than NetworkX but easier than Neo4j
- I need to "time travel" and access past states easily
- I like Datomic but prefer something open source that feels like working with local data structures
- I would prefer querying and traversing directly in Python, rather than a query language (like Cypher or GSQL)
- I need a GraphQL API that's easy to spin up and close to my data model
Features
- a graph language you can use directly in Python code
- fully versioned graphs
- in-memory access speeds
- free and real-time data persistence (via ZefHub)
- work with graphs like local data structures
- no separate query language
- no ORM
- GraphQL API with low impedance mismatch to data model
- data streams and subscriptions
Status
Zef is currently in Public Alpha.
- Private Alpha: Testing Zef internally and with a closed group of users.
- Public Alpha: Anyone can use Zef but please be patient with very large graphs!
- Public Beta: Stable enough for most non-enterprise use cases.
- Public: Stable for all production use cases.
Installation
The platforms we currently support are 64-bit Linux and MacOS. The latest version can be installed via the PyPI repository using:
pip install zef
This will attempt to install a wheel if supported by your system and compile from source otherwise. See INSTALL for more details if compiling from source.
Check out our installation doc for more details about getting up and running once installed.
Using Zef
Here's some quick points to get going. Check out our Quick Start and docs for more details.
A quick note, in Zef, we overloaded the "|" pipe so users can chain together values, Zef operators (ZefOps), and functions in sequential, lazy, and executable pipelines where data flow is left to right.
💆 Get started 💆
from zef import * # these imports unlock user friendly syntax and powerful Zef operators (ZefOps)
from zef.ops import *
g = Graph() # create an empty graph
🌱 Add some data 🌱
p1 = ET.Person | g | run # add an entity to the graph
(p1, RT.FirstName, "Yolandi") | g | run # add "fields" via relations triples: (source, relation, target)
🐾 Traverse the graph 🐾
p1 | Out[RT.FirstName] # one hop: step onto the relation
p1 | out_rel[RT.FirstName] # two hops: step onto the target
⏳ Time travel ⌛
p1 | time_travel[-2] # move reference frame back two time slices
p1 | time_travel[Time('2021 December 4 15:31:00 (+0100)')] # move to a specific date and time
👐 Share with other users (via ZefHub) 👐
g | sync[True] | run # save and sync all future changes on ZefHub
# ---------------- Python Session A (You) -----------------
g | uid | to_clipboard | run # copy uid onto local clipboard
# ---------------- Python Session B (Friend) -----------------
graph_uid: str = '...' # uid copied from Slack/WhatsApp/email/etc
g = Graph(graph_uid)
g | now | all[ET] | collect # see all entities in the latest time slice
🚣 Choose your own adventure 🚣
- Basic tutorial of Zef
- Build Wordle clone with Zef
- Import data from CSV
- Import data from NetworkX
- Set up a GraphQL API
- Use Zef graphs in NetworkX
📌 A note on ZefHub 📌
Zef is designed so you can use it locally and drop it into any existing project. You have the option of syncing your graphs with ZefHub, a service that persists, syncs, and distributes graphs automatically (and the company behind Zef). ZefHub makes it possible to share graphs with other users and see changes live, by memory mapping across machines in real-time!
You can create a ZefHub account for free which gives you full access to storing and sharing graphs forever. For full transparency, our long-term hope is that many users will get value from Zef or Zef + ZefHub for free, while ZefHub power users will pay a fee for added features and services.
Roadmap
We want to make it incredibly easy for developers to build fully distributed, reactive systems with consistent data and cross-language (Python, C++, Julia) support. If there's sufficient interest, we'd be happy to share a public board of items we're working on.
Contributing
Thank you for considering contributing to Zef! We know your time is valuable and your input makes Zef better for all current and future users.
To optimize for feedback speed, please raise bugs or suggest features directly in our community chat https://zef.chat.
Please refer to our CONTRIBUTING file and CODE_OF_CONDUCT file for more details.
License
Zef is licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Dependencies
The compiled libraries make use of the following packages:
asio
(https://github.com/chriskohlhoff/asio)JWT++
(https://github.com/Thalhammer/jwt-cpp)Curl
(https://github.com/curl/curl)JSON
(https://github.com/nlohmann/json)Parallel hashmap
(https://github.com/greg7mdp/parallel-hashmap)Ranges-v3
(https://github.com/ericniebler/range-v3)Websocket++
(https://github.com/zaphoyd/websocketpp)Zstandard
(https://github.com/facebook/zstd)pybind11
(https://github.com/pybind/pybind11)pybind_json
(https://github.com/pybind/pybind11_json)
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 Distributions
File details
Details for the file zef-0.17.1.tar.gz
.
File metadata
- Download URL: zef-0.17.1.tar.gz
- Upload date:
- Size: 720.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9f28cf3f6d0f9679b6489d244766ac9c08d3ec6db379ee8c458334f2aa8ed9 |
|
MD5 | 63e45c805311b327601c529d978d210d |
|
BLAKE2b-256 | bd2ef6699cc50e9e741c574fd78ce4c9f78264dfd70e821242f805e372a41567 |
File details
Details for the file zef-0.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f83638069e3f08832e89e4c7553615931bf2d2f882caa8dcb778926afa950e4 |
|
MD5 | ad93d5cda537f8296316d6b1a819f4b4 |
|
BLAKE2b-256 | a85108484bf69ec165b10528a5c1125bf49824b747603aea984a7ad605cde429 |
File details
Details for the file zef-0.17.1-cp311-cp311-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp311-cp311-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.11, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c988ef13f345ba5934505eeece15abe6721909eab238ce6825c1c07a656c5906 |
|
MD5 | 603d030a9022d4825d5e6dba6f5eb97d |
|
BLAKE2b-256 | 2a297610fe701e65cbe75ae8d75490e95becfe44f5a4e56e86b52edbb36a1560 |
File details
Details for the file zef-0.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 653a9df1126400c4b1c3b04e4a128e0c4c3461673654c67eee40ea87deed139b |
|
MD5 | 224cc9c704fbb4e947d12654add66f5b |
|
BLAKE2b-256 | 6a73002fba630da8f48f613dd263ea7fac83271711a89271ac90fb620a674e6b |
File details
Details for the file zef-0.17.1-cp310-cp310-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c201bc6d79501c677c2545693f911074ed7a1dc0237200ffd923b93cae298471 |
|
MD5 | 738d9123ea1b2a33892286b44e860553 |
|
BLAKE2b-256 | 4339f8304c1d04c40538a78c9332b126ef445b54bb9f9c5cf9e77a30a22dfb98 |
File details
Details for the file zef-0.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ed0fd834b0e9f8174f90163ef32438f83e4d25efb51aa096bf8b543d419e7db |
|
MD5 | 11102c9220a7a5463c1d233b1ead4cc5 |
|
BLAKE2b-256 | ec857c8f6affdc2e46073e4860c19d5be9affe810d9e458c10dad5c7a6b484cb |
File details
Details for the file zef-0.17.1-cp39-cp39-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp39-cp39-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.9, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b428d5098e676cbc499982e18ee2c025f0a5d1926abcbf8f28a1cb114c125bc9 |
|
MD5 | 3e92f2a96eef52c88ab5bf07ab673da9 |
|
BLAKE2b-256 | 9aaa9fb9115edde987dc98eec0b1ff29549a9caef5e610f9d362124f4aab4d9a |
File details
Details for the file zef-0.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9840a878f040567a9343e1009a110fb00960d86c7f26f8c5ab1544900e810412 |
|
MD5 | 143bd55d65b395ad8523747483c01fdc |
|
BLAKE2b-256 | c4198effea2aa22bea16e43d3e886a2a15d023927c7d3a53f65e4ea3aab912c9 |
File details
Details for the file zef-0.17.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zef-0.17.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb4523add66a58f1ff664d40d93f2f00c17f4a474a0b5033e2757eb8d3c3f612 |
|
MD5 | fa26a32ac77b0fecf8f14f8506565a5b |
|
BLAKE2b-256 | 23f6b157501712f1c4999959106050cf26f5114869cc49f3e16469eec993d24b |