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

Metadata

Release files for mds-exporter 0.3.2

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

Source distribution (sdist)

Source distribution for mds-exporter 0.3.2
File Size Uploaded
mds_exporter-0.3.2.tar.gz 49.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mds-exporter 0.3.2
File Interpreter ABI Platform
mds_exporter-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / mds_exporter-0.3.2.tar.gz

Download URL mds_exporter-0.3.2.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cdc00bd835592e9f0399473003aa788d5b1dcc587588cbf413b7c434e61ab0e5
BLAKE2b-256 checksum
How to use checksums
c13377dfbabb545596164c49d3987d177d1d45f0bebe6737aa3eaaad6bc0ab3b
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / mds_exporter-0.3.2-py3-none-any.whl

Download URL mds_exporter-0.3.2-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49232e6041bd02e26847385219c239e51e033472dea388794011d1b321157154
BLAKE2b-256 checksum
How to use checksums
8bdec018d9eb2286a1b812567c27830b30dfe69182672f93513147b996201de4
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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