Skip to main content

MDS Exporter

A simple CLI tool, written in Python, to manage Museum Data Service (MDS) resume API tokens and download data from the MDS API.

Installation

Install with uv. This makes the mds command available system-wide:

uv tool install mds-exporter

To run it once without installing anything:

uvx mds-exporter --help

To add it to an existing project instead:

uv add mds-exporter

Or with pip:

pip install mds-exporter

Usage

Token Versions

Each stored token keeps track of three versions to help you pick up where you left off:

base: Your original starting token (never changes) - lets you restart the whole download from scratch if needed
last: Whatever token was used most recently - keeps track of where you are in any current download
latest: The token from your most complete download (the one that got the farthest)

This setup gives you options when things go wrong or go missing. You can always use base to redownload the whole dataset from the start. If a download gets interrupted, last lets you resume right where you stopped. And latest stays safe and untouched, so you can always go back to refreshing your best/most complete dataset without messing up your current download progress.

Token Management

Store and manage MDS API tokens:

# Add a token with auto-generated name (e.g., "ancient-river")
mds token add YOUR_MDS_TOKEN

# Add a token with custom name
mds token add --name my-token YOUR_MDS_TOKEN

# List all stored tokens
mds token list

# Print a token in full so it can be copied (defaults to the 'last' version)
mds token show my-token
mds token show my-token:base

# Remove a token
mds token remove my-token

mds token list truncates tokens so they stay readable in a table. Use mds token show when you need the whole value.

Extracting Data

Extract MDS data using stored tokens or direct tokens:

# Extract using stored token (uses 'last' version by default)
mds extract --name my-token

# Extract using specific token version
mds extract --name my-token:latest
mds extract --name my-token:base

# Extract using direct token
mds extract --token YOUR_MDS_TOKEN

# Specify output file
mds extract --name my-token --output my-data.jsonl

# Compress output using zstd (recommended for large datasets)
mds extract --name my-token --compress --output my-data

The extension on --output is normalised for you. Data is written as .jsonl, or .jsonl.zst with --compress.

mds download still works as an alias but is deprecated and prints a warning. Use mds extract.

Development

uv sync
uv run pre-commit install

pre-commit runs ruff, pyrefly type checking, and the pytest suite. To run any of them on their own:

uv run pytest
uv run pyrefly check
uv run pre-commit run --all-files

Or with pip, using the exported requirements.txt:

pip install -r requirements.txt
pip install -e . --no-deps
pytest
pyrefly check

Download files

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

Source Distribution

mds_exporter-0.3.2.tar.gz (49.5 kB view details)

Uploaded Source

Built Distribution

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

mds_exporter-0.3.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file mds_exporter-0.3.2.tar.gz.

File metadata

  • Download URL: mds_exporter-0.3.2.tar.gz
  • Upload date:
  • Size: 49.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mds_exporter-0.3.2.tar.gz
Algorithm Hash digest
SHA256 cdc00bd835592e9f0399473003aa788d5b1dcc587588cbf413b7c434e61ab0e5
MD5 1cdcc074cb6d4730e3d8c4ce49307731
BLAKE2b-256 c13377dfbabb545596164c49d3987d177d1d45f0bebe6737aa3eaaad6bc0ab3b

See more details on using hashes here.

File details

Details for the file mds_exporter-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mds_exporter-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mds_exporter-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49232e6041bd02e26847385219c239e51e033472dea388794011d1b321157154
MD5 ce4432e05b4807146f3a5aee0c382ec3
BLAKE2b-256 8bdec018d9eb2286a1b812567c27830b30dfe69182672f93513147b996201de4

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