Datagraphs python client
Project description
DataGraphs Python Client
Python client library for DataGraphs.
Installation
uv add pydatagraphs
or
pip install pydatagraphs
Quick starts
from datagraphs import Client
# Connect to a project
client = Client(
project_name="my-project",
api_key="your-api-key",
)
# Check the API is reachable
print(client.status())
# Retrieve all entities of a given type
products = client.get("Product")
# Query with filters and pagination
results = client.query(q="Acme", page_size=50)
from datagraphs import Client
# Connect to a project
client = Client(
project_name="my-project",
api_key="your-api-key",
client_id="your-client-id",
client_secret="your-client-secret"
)
# Read the project schema and dataset configurations
schema = client.get_schema()
datasets = client.get_datasets()
# Update the project schema and dataset configurations
client.apply_schema(schema)
client.apply_datasets(datasets)
import json
from datagraphs import Client, Gateway, Schema, Dataset
# Connect to a project
client = Client(
project_name="my-project",
api_key="your-api-key",
client_id="your-client-id",
client_secret="your-client-secret"
)
gateway = Gateway(client)
# Load / dump data via the Gateway
gateway.dump_data("./backup")
gateway.load_data(from_dir_path="./backup")
# Load / dump project via the Gateway
schema_output_path = "./schemas/"
datasets_output_path = "./datasets/"
gateway.dump_project(schema_output_path, datasets_output_path)
with open("./schemas/myproject-model-v1.0.json") as f:
schema_data = json.load(f)
with open("./datasets/myproject-datasets-v1.0.json") as f:
datasets_data = json.load(f)
schema = Schema.create_from(schema_data)
datasets = [Dataset.create_from(d) for d in datasets_data]
gateway.load_project(schema, datasets)
For full API documentation, please see here
Authentication
For read-only access, an API key is sufficient. For write operations, supply OAuth credentials as well:
client = Client(
project_name="my-project",
api_key="your-api-key",
client_id="your-client-id",
client_secret="your-client-secret",
)
Key classes
| Class | Description |
|---|---|
Client |
HTTP client for the DataGraphs REST API |
Gateway |
Higher-level wrapper class for deploying projects and bulk export/load of data |
Schema |
In-memory representation of a project's domain model |
Dataset |
Represents a dataset within a project |
Development
Install uv, then:
uv sync # create virtualenv & install deps
uv run pytest tests -v # unit tests
uv run pytest tests_integration -v # integration tests
uv run pytest tests -v --capture=tee-sys # capturing stdout/stderr
uv run pytest --cov=src --cov-report=html # coverage report
uvx ruff check . # lint
License
MIT — Copyright (c) 2026 Data Language
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydatagraphs-0.6.0.tar.gz.
File metadata
- Download URL: pydatagraphs-0.6.0.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe52c7b2d4ddafb217afc33fbd1cc7e9821c0f57010138f47ae1ebf3a573714a
|
|
| MD5 |
255dd8cb51f62904103f4c6495509d8b
|
|
| BLAKE2b-256 |
93aac750f0d0e2a353e71d5a1da5d78ef4ad155b219ed2ada3b0b55ee6ad91e0
|
Provenance
The following attestation bundles were made for pydatagraphs-0.6.0.tar.gz:
Publisher:
release.yml on datalanguage/datagraphs-client-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydatagraphs-0.6.0.tar.gz -
Subject digest:
fe52c7b2d4ddafb217afc33fbd1cc7e9821c0f57010138f47ae1ebf3a573714a - Sigstore transparency entry: 2235698269
- Sigstore integration time:
-
Permalink:
datalanguage/datagraphs-client-py@545bdb27645f6df1419566998a14e1abaf75e74d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/datalanguage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@545bdb27645f6df1419566998a14e1abaf75e74d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pydatagraphs-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pydatagraphs-0.6.0-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9787f32548e1413c2aa12dedecd7bf93b505030804ed72860b57a985ba420216
|
|
| MD5 |
a8d1db962b73a7f101b10ec33088d3b3
|
|
| BLAKE2b-256 |
dd461cf807061e2e55f7f2e053261e67a6588ad515325e879550ae0327d4b731
|
Provenance
The following attestation bundles were made for pydatagraphs-0.6.0-py3-none-any.whl:
Publisher:
release.yml on datalanguage/datagraphs-client-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydatagraphs-0.6.0-py3-none-any.whl -
Subject digest:
9787f32548e1413c2aa12dedecd7bf93b505030804ed72860b57a985ba420216 - Sigstore transparency entry: 2235699447
- Sigstore integration time:
-
Permalink:
datalanguage/datagraphs-client-py@545bdb27645f6df1419566998a14e1abaf75e74d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/datalanguage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@545bdb27645f6df1419566998a14e1abaf75e74d -
Trigger Event:
workflow_dispatch
-
Statement type: