Simple project demonstrating the use of pydgraph, the official python client for Dgraph.
This project uses uv for dependency management. Install it with:
macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Using pip:
pip install uvFor more installation options, visit: https://docs.astral.sh/uv/getting-started/installation/
uv syncThis will create a virtual environment and install pydgraph and its dependencies.
Start by spinning up a Dgraph cluster locally. Run docker compose up. Note that the security flag
uses a blanket whitelist. This is for convenience when testing locally. Do not use this in a
production environment.
uv run python simple.pyYou can explore the source code in the simple.py file. Run docker compose down to tear down the
cluster.