Welcome to Runic

Graph ORM and Schema Migrations for FalkorDB

PyPI Python Support License

Documentation for version: 0.2.2.


runic ships two tools:

  • runic.orm — a lightweight, graph-optimized ORM that maps Python classes to FalkorDB nodes and edges.

  • runic.migrate — an Alembic-style migration engine that tracks index and constraint changes as versioned, replayable scripts.

from runic.orm import Field, Node, Repository, Session

class Person(Node, labels=["Person"]):
    id: str = Field()
    name: str = Field()
    email: str = Field(index=True, unique=True)

with Session(graph) as session:
    session.add(Person(id="alice", name="Alice", email="alice@example.com"))
    session.commit()

    repo = Repository(session, Person)
    print(repo.count())   # 1

ORM

ORM quickstart

Define your first node, open a session, and persist it in under a minute.

Quickstart
Core concepts

Node, Edge, Field, object states, dirty tracking, identity map.

Mappings
Relationships

Lazy/eager loading, polymorphic hierarchies, edge properties.

Relationships
Session & Unit of Work

add · delete · get · flush · commit · rollback · expire.

Session & Unit of Work
Query builder

Fluent filter, traversal, aggregation, fulltext and vector KNN API.

Query Builder
Schema management

IndexManager and SchemaManager — sync indexes to FalkorDB.

Schema management
ORM API reference

Full autodoc reference for every public class and function.

ORM API Reference

Migration

Migration quickstart

Install runic, run runic init, write your first migration, and apply it — all in one page.

Quickstart
CLI reference

Every command, option, and flag documented with examples.

CLI Reference
Operations reference

Full list of op.* calls available inside migration scripts.

Operations Reference
Migration API reference

runic.migrate — programmatic migration engine API.

Migration API Reference