Skip to main content

GraFlo GraFlo logo

Describe a property graph once in YAML; load it from files, SQL, RDF, APIs or Kafka into the database of your choice.

tests pre-commit PyPI Python Downloads Docs License DOI

GraFlo is a Python library that turns records from files, SQL databases, RDF, REST APIs or Kafka topics into a labeled property graph. You describe the graph once, in a YAML file called a manifest, and GraFlo creates the schema and writes the vertices and edges into the graph database of your choice, or into a directory on disk.

It is for engineers who build a graph from several sources and want its description in one reviewable file rather than spread across load scripts.

Documentation: growgraph.github.io/graflo

What you can do with it

  • Describe a graph once and load data into it. A manifest names the vertex and edge types, says which properties identify a vertex, and says how each kind of record becomes vertices and edges. The same manifest loads into ArangoDB, Neo4j, TigerGraph, FalkorDB, Memgraph, NebulaGraph, PostgreSQL or the file backend, and records with the same identity become one vertex. GraFlo also copies an existing graph from Neo4j, ArangoDB or PostgreSQL into another database (GraphEngine.migrate_graph).
  • Change the description over time, with a recorded history. Renaming a type, combining two types or changing a property type is a typed operation. Operations are recorded as commits (graflo commit, log, checkout, verify, revert) that you can replay, check and, for most operations, undo. Two branches of changes to one manifest are reconciled with a three-way merge (graflo merge3), and two manifests written by different teams are combined into one with a union (graflo merge).
  • Check and infer descriptions. GraFlo infers a manifest from a PostgreSQL database or an OWL ontology, proposes the properties that identify a record from sample data, and checks a manifest against a conformance profile (graflo check), a set of modeling rules such as "every vertex type declares its identity".

A taste

A manifest has three blocks: schema says what the graph looks like, ingestion_model says how records map onto it, and bindings says where the records come from. This one reads CSV files with the columns person_id, person and department:

schema:
    metadata: {name: hr}
    graph:
        vertex_config:
            vertices:
            -   {name: person, properties: [id, name], identity: [id]}
            -   {name: department, properties: [name], identity: [name]}
        edge_config:
            edges: [{source: person, target: department}]
ingestion_model:
    resources:
    -   name: departments
        pipeline:
        -   {vertex: person, from: {id: person_id, name: person}}
        -   {vertex: department, from: {name: department}}
bindings:
    connectors:
    -   {regex: "^dep.*\\.csv$", sub_path: data, resource_name: departments}

This loads it into ArangoDB:

from graflo import GraphEngine, GraphManifest
from graflo.connections import ArangoConfig

manifest = GraphManifest.from_yaml("manifest.yaml")
manifest.finish_init()
engine = GraphEngine()
engine.define_and_ingest(manifest=manifest, target_db_config=ArangoConfig.from_env())

ArangoConfig.from_env() reads ARANGO_URI, ARANGO_USERNAME, ARANGO_PASSWORD and ARANGO_DATABASE; every database has such a class. See Database connections.

Documentation

Full documentation: growgraph.github.io/graflo

  • Quick start: two CSV files into a graph, step by step
  • Creating a manifest: the three blocks of a manifest
  • Examples: runnable examples, one question each, with their data under examples/
  • Concepts: schema, identity, ingestion, connectors, evolution and version control
  • Guides: database connections, graph migration, schema inference, API wiring, bulk load
  • GraFlo ontology: a manifest as RDF (graflo manifest-to-rdf, graflo rdf-to-manifest)

Installation

GraFlo needs Python 3.11 or newer. The database clients, RDF and Kafka support are part of the default install.

pip install graflo

Optional extras (see the Installation guide):

  • dev: pytest and its plugins, hypothesis, ty, pre-commit
  • docs: ProperDocs and its plugins, for building the documentation site
  • plot: draws graflo plot-manifest and the --plot figures of graflo merge and graflo merge3 (SVG, PDF, PNG); no system Graphviz or fonts needed
pip install "graflo[dev,docs,plot]"

Development

To install from a clone:

git clone git@github.com:growgraph/graflo.git && cd graflo
uv sync --extra dev --extra plot

See the Contributing Guide for the full workflow.

Tests

The database tests need the database containers. Start them from a clone with the scripts under docker/:

cd docker
./start-all.sh    # Start all services
./stop-all.sh     # Stop all services
./cleanup-all.sh  # Remove containers and volumes

Per-engine compose files and ports are documented in the docker README.

To run the tests:

uv run pytest test

TigerGraph, NebulaGraph and Kafka tests are skipped unless you pass --run-tigergraph, --run-nebula or --run-kafka.

The suites that need no database run without the containers, and CI runs them on every pull request:

uv run pytest test --ignore=test/db --ignore=test/data_source --ignore=test/object_storage

License

Open source under the Apache License 2.0. Copyright and trademark notices are in NOTICE: the license grants no rights in the GraFlo and GrowGraph marks. Releases before the relicensing shipped under the Business Source License 1.1 and keep those terms; see the changelog.

Contributing

Contributions are welcome. See the Contributing Guide. Contributors accept the Contributor License Agreement once, by commenting on their first pull request.

Metadata

Release files for graflo 1.16.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graflo 1.16.3
File Size Uploaded
graflo-1.16.3.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for graflo 1.16.3
File Interpreter ABI Platform
graflo-1.16.3-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 MB

Release files / graflo-1.16.3.tar.gz

Download URL graflo-1.16.3.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
08b6236045e5e2f99d946036aec0c76b83c9946b8a97e150c76cdbd49219d852
BLAKE2b-256 checksum
How to use checksums
dba97ce26e0de21ea1b68b6c706794f00a5ef167eee16180f495683a84ad6b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / graflo-1.16.3-py3-none-any.whl

Download URL graflo-1.16.3-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
03bc1fe57cdee638ceb9e83fbdea5bb66b2ced589fdfa13b80518c6bf84cc0b7
BLAKE2b-256 checksum
How to use checksums
12275c4fecedb2899f06c563441463bbf14ac2d9e03ddfd4e4c3ad168312a19b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.16.3 This release

2 release files

1.15.0

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.5

2 release files

1.13.4

2 release files

1.13.3

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.11.1

2 release files

1.10.2

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.16

2 release files

1.8.14

2 release files

1.8.13

2 release files

1.8.12

2 release files

1.8.10

2 release files

1.8.9

2 release files

1.8.8

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.34

2 release files

1.7.33

2 release files

1.7.32

2 release files

1.7.31

2 release files

1.7.30

2 release files

1.7.29

2 release files

1.7.28

2 release files

1.7.27

2 release files

1.7.26

2 release files

1.7.25

2 release files

1.7.23

2 release files

1.7.22

2 release files

1.7.21

2 release files

1.7.20

2 release files

1.7.19

2 release files

1.7.18

2 release files

1.7.17

2 release files

1.7.16

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.12

2 release files

1.3.11

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page