Datasets
A dataset is a versioned data file with a title, description, tags, license and citation. You can keep training data or measured results beside the circuits that use them. Every upload becomes a new version, identified by the SHA-256 hash of its content.
Formats
Section titled “Formats”A dataset has one declared format: CSV, NPY, HDF5, JSON or Parquet. QubitHub stores each upload as data.<format>, and does not check that the file’s content matches the format you declared, so upload the right kind of file.
Get a token
Section titled “Get a token”The dataset API takes a Bearer token. API keys are not accepted on these routes. Log in to get one; it is valid for 15 minutes. When calls return 401, run the login step again:
read -rsp "Password: " QH_PASSWORD; echo | curl -s -X POST https://qubithub.co/api/auth/login -H "Content-Type: application/json" -d @- \ | jq -r .access_token)See Authentication for refresh tokens and the other options.
Create a dataset
Section titled “Create a dataset”DATASET_ID=$(curl -s -X POST https://qubithub.co/api/datasets \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"name": "bell-counts", "title": "Bell state counts", "format": "csv", "is_public": false}' \ | jq -r .id)Datasets are public by default ("is_public": true). Optional fields are description (Markdown), tags, license (e.g. MIT) and citation (BibTeX or APA).
On the Free tier during beta you can own up to 5 datasets; creating a sixth returns 403.
Keep the dataset’s id. There is no list of your own datasets yet, and the public list (GET /api/datasets) shows public datasets only.
Upload a version
Section titled “Upload a version”curl -s -X POST "https://qubithub.co/api/datasets/$DATASET_ID/versions?commit_message=First%20run" \ | jq '{version_number, commit_hash, size_bytes}'Only the owner can upload. Each new file becomes the next version (1, 2, …). If you upload exactly the same bytes as an existing version, you get that version back, and no new one is created.
Download
Section titled “Download”curl -s -f -o bell-counts.csv "https://qubithub.co/api/datasets/$DATASET_ID/download" \ -H "Authorization: Bearer $TOKEN"Download always returns the latest version. There’s no way yet to download an earlier one. A public dataset downloads without a token.
Statistics
Section titled “Statistics”curl -s "https://qubithub.co/api/datasets/$DATASET_ID/stats" -H "Authorization: Bearer $TOKEN"Returns downloads_count, stars_count, forks_count and size_bytes.
POST /api/datasets/{id}/fork copies a dataset you can open into your account, optionally with {"name": "my-copy"}. Forks are limited to 5 per minute.
curl -s -X POST https://qubithub.co/api/datasets/$DATASET_ID/fork \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"name": "my-copy"}' | jq '{id, name, forked_from}'Who can read a dataset
Section titled “Who can read a dataset”- Public: anyone, including signed-out visitors.
- Private, owned by a person: the owner only.
- Private, owned by an organization: it is not consistent yet. Active members of the organization can preview, read the statistics of, and fork the dataset, but opening its details and downloading it are limited to the owner. Treat a private organization dataset as owner-only until this is fixed.
Not yet
Section titled “Not yet”- Preview.
GET /api/datasets/{id}/previewcurrently fails with a server error for any dataset that has rows. Download the file instead. - CLI commands for datasets.
- Downloading an earlier version.
- Checking an upload against the declared format.
- A list of your own datasets, including the private ones.
- A public gallery.
Next steps
Section titled “Next steps”- Spaces: run Python next to your circuits.
- Authentication: tokens and how long they last.
- API reference: every route.
Need help? See Troubleshooting or email [email protected].