Skip to main content

deepx-client

deepx-client is the Python client for a DeepH-serve instance. It submits POSCAR files, watches asynchronous jobs and downloads the predicted Hamiltonian, band structure and DOS artifacts.

The client only speaks the public /v1 HTTP API. It does not import the server, JAX or DeepH-pack, so installing it is lightweight. It is a Python SDK; no console command is installed yet.

Install

From PyPI (after release):

pip install deepx-client

From this repository:

uv pip install -e "./client[dev]"
# or
pip install -e ./client

The import package is deepx_client. The old DeepHClient class name and the deeph_client import path remain available for compatibility; new code should use DeepXClient and deepx_client.

Python API

from deepx_client import DeepXClient

with DeepXClient("http://127.0.0.1:8000", api_key="...") as client:
    job = client.submit(
        open("POSCAR").read(),
        tasks=["hamiltonian", "band"],
        band={"npoints": 200, "energy_window": [-5, 5]},
    )
    job = client.wait(job.id, on_update=lambda item: print(item.stage, item.progress))
    paths = client.download_all(job.id, "./results")
    print(paths)

A complete runnable example is examples/python_client.py:

export DEEPH_SERVE_URL=http://127.0.0.1:8000
export DEEPH_SERVE_API_KEY=...
python examples/python_client.py POSCAR --tasks hamiltonian --out results

Configure

The server URL and API key can be supplied with environment variables:

export DEEPH_SERVE_URL=http://127.0.0.1:8000
export DEEPH_SERVE_API_KEY=...

or in ~/.config/deepx/client.toml:

default = "lab"

[profiles.lab]
server = "https://deeph.example.com"
api_key = "..."
timeout = 30.0
verify = true

The old ~/.config/deeph/client.toml path is still read when the new path does not exist. Precedence: explicitly passed values > environment > selected profile > defaults.

Python API reference

from deepx_client import DeepXClient

with DeepXClient("http://127.0.0.1:8000", api_key="...") as client:
    job = client.submit(
        open("POSCAR").read(),
        tasks=["hamiltonian", "band"],
        band={"npoints": 200, "energy_window": [-5, 5]},
    )
    job = client.wait(job.id)
    paths = client.download_all(job.id, "./results")

DeepXClient exposes health(), models(), submit(), submit_request(), submit_and_wait(), get(), list(), artifacts(), wait(), cancel(), delete(), download() and download_all().

Errors

  • APIError: non-success response; carries status_code, code, details and request_id.
  • JobFailedError: job ended as failed, canceled or expired.
  • JobTimeoutError: local wait timeout elapsed.
  • ArtifactVerificationError: downloaded file did not match the manifest sha256.
  • ConfigError: invalid local profile or configuration.

All errors derive from DeepHClientError.

Compatibility aliases

The distribution deeph-client is a compatibility alias that depends on deepx-client. It keeps old imports working:

from deeph_client import DeepHClient

New code should use deepx_client and DeepXClient.

Development

cd client
uv venv .venv
uv pip install --python .venv/bin/python -e ".[dev]"
.venv/bin/python -m pytest
.venv/bin/python -m ruff check src tests
.venv/bin/python -m black --check src tests

License

GPL-3.0-or-later, matching DeepH-serve. See LICENSE.

Metadata

Release files for deepx-client 0.1.0

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

Source distribution (sdist)

Source distribution for deepx-client 0.1.0
File Size Uploaded Provenance Actions
deepx_client-0.1.0.tar.gz 33.7 kB Without provenance Details for deepx_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deepx-client 0.1.0
File Interpreter ABI Platform Actions
deepx_client-0.1.0-py3-none-any.whl Python 3 none any Details for deepx_client-0.1.0-py3-none-any.whl

Total release size: 64.0 kB

Release files / deepx_client-0.1.0.tar.gz

Download URL deepx_client-0.1.0.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
36b3eaac346a10df9a6c657b23d2c1ee5ad81f614ba5ed3ce96af5b17455c0c1
BLAKE2b-256 checksum
How to use checksums
c205aac130375aa6ef738232aafdf5b01492c74468e4c3065e99706905d4bf83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / deepx_client-0.1.0-py3-none-any.whl

Download URL deepx_client-0.1.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
726ecd38a367753f0b60fc3a682e0db7d309042e557da56d5e0a3e898ad440bd
BLAKE2b-256 checksum
How to use checksums
39a8f6da29e5411cd6f8555bb4cda483657110c79e5f9f7d3e11d4b5c0c1e502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for deepx-client 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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