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. DeepHClient remains available as a class alias. The old deeph_client import path is provided by the separate deeph-client compatibility distribution. 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)

    account = client.me()
    print(account.plan, account.daily_used, account.hop_available)
    receipt = client.exchange_hop("structures.zip")
    print(receipt.credited_hop, receipt.review_status)

Structure exchanges require a server with the shared /v1/me/hop/exchanges endpoint (DeepH-serve API 0.2.5 or newer).

The optional internal CLI runs as python -m deepx_client:

python -m deepx_client account
python -m deepx_client hop exchange structures.zip
python -m deepx_client hop list

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

Each API key is bound to one account; the owner can copy it from the web console's API access page. 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(), me(), usage(), hop_exchanges(), exchange_hop(), models(), random_structure(), analyze_structure(), 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.2.0

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

Built distribution (wheel)

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

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

Download URL deepx_client-0.2.0-py3-none-any.whl
Size 32.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49eeafab89eff9078d9a4abebca041f16ea20f54fd236139de0f548bda3e0046
BLAKE2b-256 checksum
How to use checksums
3a91b625bccf33ea2ce44ca67b678d4bf8d07b2874b2071ecedfa405b84e5f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for deepx-client 0.2.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.2.0 This release

1 release file 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