Skip to main content

Open datasets, open source — a CLI for publishing and consuming open datasets.

Project description

datum-cli

The command-line tool for Datum — publish and consume open data with a single command.

datum pull norges-bank.reports.financial-stability:2024

Installation

pip install datumhub-cli

Requires Python 3.11+.


How it works

Every dataset in Datum has a three-part identifier:

publisher.namespace.dataset:version

For example: met.no.weather.oslo-hourly:2024-01

The metadata lives in a datapackage.json file — a small JSON document that describes where the data files are hosted, their format, size, and checksum. Datum never hosts the data itself.


Quick start

1. Describe your dataset

datum init

Walks you through creating a datapackage.json interactively.

2. Validate it

datum check datapackage.json

3. Publish to your local registry

datum publish datapackage.json

4. Pull it anywhere

datum pull publisher.namespace.dataset:version

Files land in ./dataset/ in your current directory. The local cache at ~/.datum/cache/ is used for deduplication — pulling the same dataset in a second directory copies from cache with no network request.


Commands

Publishing

Command Description
datum init Create a datapackage.json via an interactive wizard
datum check [FILE] Validate a datapackage.json against the Datum schema
datum publish [FILE] Publish dataset metadata to the registry

Consuming

Command Description
datum pull IDENTIFIER Download a dataset and verify its checksum
datum info IDENTIFIER Show full metadata for a dataset
datum list List all datasets in the registry
datum search QUERY Search the registry by keyword

Cache

Command Description
datum cache list Show all cached datasets
datum cache size Show total cache disk usage
datum cache clear Remove all cached files

Configuration

Command Description
datum config set KEY VALUE Set a configuration value
datum config get KEY Get a configuration value
datum config show [KEY] Show one key or all configuration
datum config unset KEY Remove a configuration key

Authentication

Command Description
datum login [URL] Authenticate with a registry
datum logout [URL] Remove stored credentials

Global flags

Global flags must come before the subcommand:

datum --output json list
datum --quiet pull publisher.namespace.dataset:1.0.0
datum --registry https://datumhub.org pull publisher.namespace.dataset
Flag Description
--output, -o Output format: table (default), json, plain
--quiet, -q Suppress non-essential output
--registry Override the default registry URL or path
--verbose, -v Emit additional diagnostic information

The datapackage.json format

{
  "id": "publisher.namespace.dataset",
  "version": "1.0.0",
  "title": "My Dataset",
  "description": "A short description.",
  "license": "CC-BY-4.0",
  "publisher": {
    "name": "Publisher Name",
    "url": "https://example.com"
  },
  "tags": ["tag1", "tag2"],
  "sources": [
    {
      "url": "https://example.com/data.csv",
      "format": "csv",
      "size": 204800,
      "checksum": "sha256:abc123..."
    }
  ]
}

Pull behaviour

# Pull a specific version
datum pull publisher.namespace.dataset:1.0.0

# Pull the latest published version
datum pull publisher.namespace.dataset

# Re-download even if the file already exists locally
datum pull publisher.namespace.dataset:1.0.0 --force

Files are placed in ./dataset/ relative to your current directory. Once a file exists there, subsequent pulls skip it — your local edits are safe.


Configuration

# Set a default registry
datum config set registry https://datumhub.org

# Set a default output format
datum config set output json

# View all configuration
datum config show

Configuration is stored at ~/.datum/config.json.


Status

Early development. The CLI is functional for local workflows. Remote registry support via DatumHub is coming.


License

MIT

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

datumhub_cli-0.1.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

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

datumhub_cli-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file datumhub_cli-0.1.0.tar.gz.

File metadata

  • Download URL: datumhub_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datumhub_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8441802a79a0c43058202833d812f178e1b70e49cbce7db5b9fddf0bde3012e2
MD5 fd025d27a4f3518116d51f0512fbecd7
BLAKE2b-256 427dfb6738b785330b8fffdb41e72712e7ff44ca1949589b67131109efafaa3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for datumhub_cli-0.1.0.tar.gz:

Publisher: publish.yml on simkjels/datumhub-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datumhub_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: datumhub_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datumhub_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69659c1a0ce96c6759e6c62e4d08f80b0d8bf3c21597e548067458aac413e9bd
MD5 3c1d239e6dc9b58c92cec6c7a6a55aa8
BLAKE2b-256 9b5e15d9e4a418fae0950516f16efcbc8812a5deb0681e45a439f53dd3426361

See more details on using hashes here.

Provenance

The following attestation bundles were made for datumhub_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on simkjels/datumhub-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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