Home

pyki

pyki is an open-source Python library that provides a lightweight platform for creating, querying, and reasoning over simple knowledge graphs within Python applications. The project emphasizes a compact API, interoperability with existing data formats, and easy integration with data science workflows. It aims to serve developers who want to embed knowledge graph capabilities without adopting heavier RDF stacks or database-backed graph systems.

Its data model centers on nodes and edges, with user-definable types and properties. Queries are expressed through

Usage typically begins by constructing a Graph object, adding nodes and relationships, optionally attaching metadata, and

Development and governance are community-driven, with contributions managed through an open repository and accompanying documentation. The

See also: NetworkX, rdflib, PyKEEN.

a
Pythonic
API
that
supports
simple
pattern
matching,
filters,
and
basic
traversal.
The
library
offers
optional
serialization
to
common
formats
such
as
JSON-LD
and
RDF,
and
can
import
data
from
CSV,
JSON,
or
RDF
sources.
For
reasoning,
pyki
provides
a
small
rule
engine
that
can
infer
transitive
relationships
and
derive
simple
classifications
based
on
user-defined
rules.
The
architecture
favors
modularity,
with
pluggable
backends
for
storage
and
optional
in-memory
or
on-disk
graphs.
then
running
queries
or
exporting
results.
The
project
integrates
with
data
science
tools
in
the
Python
ecosystem,
including
pandas
and
Jupyter
notebooks.
pyki
is
designed
to
be
extensible,
allowing
developers
to
implement
custom
storage
backends,
serializers,
and
rule
sets
to
fit
specific
domain
needs.
project
adopts
an
permissive
license
to
encourage
adoption
and
collaboration.
In
comparison
to
larger
graph
ecosystems,
pyki
emphasizes
simplicity
and
rapid
experimentation
for
small
to
medium-scale
knowledge
graphs.