{"id":15061619,"url":"https://github.com/zefhub/zef","last_synced_at":"2025-04-06T21:15:07.739Z","repository":{"id":37432848,"uuid":"446694499","full_name":"zefhub/zef","owner":"zefhub","description":"Toolkit for graph-relational data across space and time","archived":false,"fork":false,"pushed_at":"2024-09-03T22:11:34.000Z","size":10930,"stargazers_count":113,"open_issues_count":4,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-30T17:09:55.008Z","etag":null,"topics":["data-oriented","data-oriented-design","data-oriented-programming","distributed","distributed-database","distributed-systems","domain-specific-language","graph","graph-database","graphdb","graphql","immutable","in-memory","in-memory-database","knowledge-graph","neo4j","stream-processing","streams","version-control","versioning"],"latest_commit_sha":null,"homepage":"https://zef.zefhub.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zefhub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-11T05:51:35.000Z","updated_at":"2025-01-02T04:25:37.000Z","dependencies_parsed_at":"2024-03-14T06:30:24.654Z","dependency_job_id":"5b64b58e-574d-4925-b53b-c7f36e35d002","html_url":"https://github.com/zefhub/zef","commit_stats":null,"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhub%2Fzef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhub%2Fzef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhub%2Fzef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhub%2Fzef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefhub","download_url":"https://codeload.github.com/zefhub/zef/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247550690,"owners_count":20956987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-oriented","data-oriented-design","data-oriented-programming","distributed","distributed-database","distributed-systems","domain-specific-language","graph","graph-database","graphdb","graphql","immutable","in-memory","in-memory-database","knowledge-graph","neo4j","stream-processing","streams","version-control","versioning"],"created_at":"2024-09-24T23:22:39.623Z","updated_at":"2025-04-06T21:15:07.715Z","avatar_url":"https://github.com/zefhub.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"300px\" src=\"https://github.com/zefhub/zefhub-web-assets/blob/main/zef_logo_white.png#gh-dark-mode-only\"\u003e\n    \u003cimg width=\"300px\" src=\"https://github.com/zefhub/zefhub-web-assets/blob/main/zef_logo_black.png#gh-light-mode-only\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    A data-oriented toolkit for graph data\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eversioned graphs + streams + query using Python + GraphQL\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/zefhub/zef/actions/workflows/on-master-merge.yml\"\u003e\n      \u003cimg src=\"https://github.com/zefhub/zef/actions/workflows/on-master-merge.yml/badge.svg\" alt=\"Workflow status badge\" loading=\"lazy\" height=\"20\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/zefhub/zef/blob/master/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/license-Apache%202.0-teal\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/zefhub\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/zefhub.svg?style=social\u0026label=Follow\"\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://zef.zefhub.io/\"\u003eDocs\u003c/a\u003e\n    \u003cspan\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n    \u003ca href=\"https://www.zefhub.io/\"\u003eZefHub\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n![gif showing Zef demo intro](https://raw.githubusercontent.com/zefhub/zefhub-web-assets/main/zef_demo_intro.gif)\n\n\u003cbr /\u003e\n\n## Description\n\nZef 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.\n\nIf any of these apply to you, Zef might help:\n\n- I need a graph database with fast query speeds and hassle-free infra\n- I need a graph data model that's more powerful than NetworkX but easier than Neo4j\n- I need to \"time travel\" and access past states easily\n- I like Datomic but prefer something open source that feels like working with local data structures\n- I would prefer querying and traversing directly in Python, rather than a query language (like Cypher or GSQL)\n- I need a GraphQL API that's easy to spin up and close to my data model\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Features\n\n- a graph language you can use directly in Python code\n- fully versioned graphs\n- in-memory access speeds\n- free and real-time data persistence (via ZefHub)\n- work with graphs like local data structures\n- no separate query language\n- no ORM\n- GraphQL API with low impedance mismatch to data model\n- data streams and subscriptions\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Status\n\nZef is currently in Public Alpha.\n\n- [x] Private Alpha: Testing Zef internally and with a closed group of users.\n- [x] Public Alpha: Anyone can use Zef but please be patient with very large graphs!\n- [ ] Public Beta: Stable enough for most non-enterprise use cases.\n- [ ] Public: Stable for all production use cases.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Installation\n\nThe platforms we currently support are 64-bit Linux and MacOS. The latest version can be installed via the PyPI repository using:\n\n```bash\npip install zef\n```\n\nThis 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.\n\nCheck out our [installation doc](https://zef.zefhub.io/installing-zef) for more details about getting up and running once installed.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Using Zef\n\nHere's some quick points to get going. Check out our [Quick Start](https://zef.zefhub.io/quick-start) and docs for more details.\n\nA 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.\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e💆 Get started 💆\u003c/h3\u003e\n\u003c/div\u003e\n\n```python\nfrom zef import *          # these imports unlock user friendly syntax and powerful Zef operators (ZefOps)\nfrom zef.ops import *\n\ng = Graph()                # create an empty graph\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e🌱 Add some data 🌱\u003c/h3\u003e \n\u003c/div\u003e\n\n```python\np1 = ET.Person | g | run                  # add an entity to the graph\n\n(p1, RT.FirstName, \"Yolandi\") | g | run   # add \"fields\" via relations triples: (source, relation, target)\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e🐾 Traverse the graph 🐾\u003c/h3\u003e\n\u003c/div\u003e\n\n```python\np1 | out_rel[RT.FirstName]   # one hop: step onto the relation\n\np1 | Out[RT.FirstName]       # two hops: step onto the target\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e⏳ Time travel ⌛\u003c/h3\u003e\n\u003c/div\u003e\n\n```python\np1 | time_travel[-2]                                        # move reference frame back two time slices\n\np1 | time_travel[Time('2023 January 1 12:34:56 (+0100)')]   # move to a specific date and time\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e👐 Share with other users (via ZefHub) 👐\u003c/h3\u003e\n\u003c/div\u003e\n\n```python\ng | sync[True] | run                            # save and sync all future changes on ZefHub\n\n# ---------------- Python Session A (You) -----------------\ng | uid | to_clipboard | run                    # copy uid onto local clipboard\n\n# ---------------- Python Session B (Friend) -----------------\ngraph_uid: str = '...'                          # uid copied from Slack/WhatsApp/email/etc\ng = Graph(graph_uid)\ng | now | all[ET] | collect                     # see all entities in the latest time slice\n```\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e🚣 Choose your own adventure 🚣\u003c/h3\u003e\n\u003c/div\u003e\n\n- [Basic tutorial of Zef](https://zef.zefhub.io/employee-database)\n- [Build Wordle clone with Zef](https://blog.zefhub.io/build-wordle-in-30-lines-of-python/)\n- [Import data from CSV](https://zef.zefhub.io/multiple-interlinked-csvs)\n- [Import data from NetworkX](https://zef.zefhub.io/graph-formats)\n- [Set up a GraphQL API](https://zef.zefhub.io/quick-api-creation)\n- [Use Zef graphs in NetworkX](https://zef.zefhub.io/network-x-interface)\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e📌 A note on ZefHub 📌\u003c/h3\u003e\n\u003c/div\u003e\n\nZef 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](https://zef.zefhub.io/collaborate), by memory mapping across machines in real-time!\n\nYou 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.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Roadmap\n\nWe 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.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Contributing\n\nThank you for considering contributing to Zef! We know your time is valuable and your input makes Zef better for all current and future users.\n\nTo optimize for feedback speed, please raise bugs or suggest features directly in our community chat [https://zef.chat](https://zef.chat).\n\nPlease refer to our [CONTRIBUTING file](https://github.com/zefhub/zef/blob/master/CONTRIBUTING.md) and [CODE_OF_CONDUCT file](https://github.com/zefhub/zef/blob/master/CODE_OF_CONDUCT.md) for more details.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## License\n\nZef is licensed under the Apache License, Version 2.0 (the \"License\"). You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Dependencies\n\nThe compiled libraries make use of the following packages:\n\n- `asio` (https://github.com/chriskohlhoff/asio)\n- `JWT++` (https://github.com/Thalhammer/jwt-cpp)\n- `Curl` (https://github.com/curl/curl)\n- `JSON` (https://github.com/nlohmann/json)\n- `Parallel hashmap` (https://github.com/greg7mdp/parallel-hashmap)\n- `Ranges-v3` (https://github.com/ericniebler/range-v3)\n- `Websocket++` (https://github.com/zaphoyd/websocketpp)\n- `Zstandard` (https://github.com/facebook/zstd)\n- `pybind11` (https://github.com/pybind/pybind11)\n- `pybind_json` (https://github.com/pybind/pybind11_json)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefhub%2Fzef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefhub%2Fzef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefhub%2Fzef/lists"}