https://github.com/mathisxy/edgygraph
Typed Graph Framework in Python for building Pipelines
https://github.com/mathisxy/edgygraph
graph graphs langgraph pipeline pydantic-v2 python python3 python3-13 python313
Last synced: about 1 month ago
JSON representation
Typed Graph Framework in Python for building Pipelines
- Host: GitHub
- URL: https://github.com/mathisxy/edgygraph
- Owner: mathisxy
- License: mit
- Created: 2026-01-11T21:21:58.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-02-16T00:39:12.000Z (about 1 month ago)
- Last Synced: 2026-02-16T08:19:58.645Z (about 1 month ago)
- Topics: graph, graphs, langgraph, pipeline, pydantic-v2, python, python3, python3-13, python313
- Language: Python
- Homepage: https://mathisxy.github.io/edgygraph/
- Size: 750 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
- Roadmap: .github/ROADMAP.md
Awesome Lists containing this project
README
# Typed Graph-based Pipeline Builder
[](https://pypi.org/project/edgygraph/)
[](https://pypi.org/project/edgygraph/#files)
[](https://github.com/mathisxy/edgygraph/issues)
[](https://github.com/mathisxy/Edgy-Graph/actions/workflows/typecheck.yml)
[](https://github.com/mathisxy/Edgy-Graph/actions/workflows/docs.yml)
[](https://mathisxy.github.io/edgygraph/)
A **pydantically** typed, lightweight **graph framework** for Python that combines features from [Langgraph](https://github.com/langchain-ai/langgraph) with **static type security**.
A community collection of nodes will be available [here](https://www.github.com/mathisxy/edgynodes/).
## Overview
- **Pydantic Typing**:
Built on Pydantic and Generics for complete static type safety.
- **Inheritance and Variance**:
Easily extend and specialize state and node classes.
- **Parallel Task Processing**:
Multiple nodes can run simultaneously
- **Dual State Management**:
- State with automatic change extraction and conflict detection
- Shared state accessible by all nodes, protected via explicit locking
- **Flexible Routing**:
Define simple node-to-node edges or dynamic routing based on functions.
- **Streaming**:
A standardized interface for streaming data between nodes.
## Installation
### PyPI
```bash
pip install edgygraph
```
> Python 3.13+ is required
## Example Workflow
### Import Classes
```python
from edgygraph import State, Shared, Node, START, END, Graph
import asyncio
```
### Create a State
```python
class MyState(State):
capslock: bool = False
```
### Create a Node
```python
class MyNode(Node[MyState, Shared]):
async def __call__(self, state: MyState, shared: Shared) -> None:
if state.capslock:
print("HELLO WORLD!")
else:
print("Hello World!")
```
### Create Instances
```python
state = MyState(capslock=True)
shared = Shared()
node = MyNode()
```
### Create a Graph
```python
Graph[MyState, Shared](
edges=[
(
START,
node
),
(
node,
END
)
]
)
```
### Run Graph
```python
asyncio.run(graph(state, shared))
```
> More examples can be found in the examples folder