Install & Compatibility
Where this runs
tested against v25.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 40.4MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.0s · import 0.000s · 38MB
37MB installed
● package 37MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DgraphClient
✓ from pydgraph import DgraphClient
✗ from pydgraph import stub
DgraphClientStub
✓ from pydgraph import DgraphClientStub
Txn
✓ from pydgraph import Txn
Connect to a local Dgraph instance, set schema, query data.
import pydgraph
# Create a client stub
client_stub = pydgraph.DgraphClientStub('localhost:9080')
# Create a client
client = pydgraph.DgraphClient(client_stub)
# Set schema
schema = 'name: string @index(exact) .'
op = pydgraph.Operation(schema=schema)
client.alter(op)
# Create a transaction and run a query
txn = client.txn(read_only=True)
res = txn.query('{"me": function(func: eq(name, "Alice")) { name }}')
print(res.json)
txn.discard()
# Close the stub
client_stub.close()
Upgrade
Version history
25.2.0latest on PyPI · released Feb 25, 2026
Audit
Dependencies
grpciorequiredgRPC communication with Dgraph server
protobufrequiredProtocol Buffers for data serialization