Skip to main content

dmax

Project description

An (incomplete) alternative API client for data management systems at the Advanced Photon Source that supports both synchronous and asynchronous API calls.

https://img.shields.io/pypi/v/dmax.svg https://github.com/spc-group/dmax/actions/workflows/ci.yml/badge.svg

Why dmax?

The aps-dm-api package is available for accessing the various APIs in python. Compared to aps-dm-api, dmax is:

  • Awaitable - dmax has both a block and asynchronous client that share the same logic

  • Explicit - parameters can be passed to a client rather than relying primarily on environmental variables.

  • On PyPI - aps-dm-api can only be installed from conda-forge.

While we hope that dmax is useful, it is not intended as a complete replacement for aps-dm-api. Features are added only as needed.

Installation

The following will download the package and load it into the python environment.

pip install dmax

Usage

The main interface for dmax is the dmax.Client class, or its asynchronous counterpart dmax.AsyncClient.

dmax can be used either by as a stand-alone library, where the data management API parameters are passed in explicitly, or embedded in an existing data-management environment, where the API connection parameters are defined in environmental variables.

Stand-alone

The client is given the login credentials, along with the station name and any API URIs that it needs to connect.

import dmax

client = dmax.Client(
    username="spam",
    password="secret",
    station_name="255IDZ",
    scheduling_uri: str = "https://example.com:11337",
    data_storage_uri: str = "https://example.com:22237",
    processing_uri: str = "https://example.com:55536",
)

proposals = client.proposals(cycle="2026-3")

experiments = client.experiments()
experiment = client.experiment(name="cabana-2026-3")

If the URI’s are omitted, the client will attempt to guess sensible defaults from the station name, for example station_name=”255IDZ” will produce URIs like https://s255idzdm.xray.aps.anl.gov:55536.

Embedded in a DM Environment

The APS data management system uses an extensive set of environmental variables to handle the API parameters. If any parameters or not provided to the client, environmental variables will be used if available:

import dmax

client = dmax.Client()

esafs = client.esafs(year=2026)

Running the Tests

uv run --dev pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmax-0.0.3.tar.gz (104.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmax-0.0.3-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file dmax-0.0.3.tar.gz.

File metadata

  • Download URL: dmax-0.0.3.tar.gz
  • Upload date:
  • Size: 104.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Red Hat Enterprise Linux","version":"9.7","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dmax-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8178fadfc7d4e90e4920bf7bb3f4c8629b40f946afe717799d50c44e4658c2e2
MD5 d0b3ea64e1956671bfb906d320e42224
BLAKE2b-256 cd018a0a151237adc5542c2c0089045273ebf81db700360a31ed2576cdb1ba87

See more details on using hashes here.

File details

Details for the file dmax-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: dmax-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Red Hat Enterprise Linux","version":"9.7","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dmax-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8ac908bac25a339e9eb054dfa7a536de3e42d2994a2db781f0bdd07a1945c5e6
MD5 2b86fa1bc90e54ddada014fc85d97045
BLAKE2b-256 9a02b2b37c78820385f23de3bce6c887c1a3ede1e2231eed35ffd1b9ae827759

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page