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.1.tar.gz (48.8 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mds_exporter-0.3.1.tar.gz
  • Upload date:
  • Size: 48.8 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.1.tar.gz
Algorithm Hash digest
SHA256 b550fb1f69178a48c0e1ac4d163e957d4d4d5b254e1c439b4566b0806df3b575
MD5 7c1a86743c6d30116e201bb614a8a7b7
BLAKE2b-256 52558c8ae795988efd13306b6ea89ba3b4d6c2a3ead57c796266939ffd0c12ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mds_exporter-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60bf8709b75074ce62c272a8be5233385ee5b60b456b8e9915d547094199697b
MD5 2ca627a6c3d68538aeb8c4767c732cf3
BLAKE2b-256 a0289905b1d7762c5d7cc5091a45b8850e8db6a89a31f70a621fd70f66b10960

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