Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TCIA Utils 4.0

TCIA Utils is a Python client for discovering TCIA datasets, participants, clinical evidence, available data, citations, and verified analytical publications. It uses the shared TCIA V2 REST service. A researcher can start with a question about a dataset without choosing the underlying catalog or storage system.

Version 4.0.0a7 is an opt-in preview for testing the redesigned interface. Ordinary pip installations continue selecting stable 3.x. Install this version explicitly in a fresh Python 3.11+ environment:

python -m pip install "tcia_utils[tables,downloads]==4.0.0a7"

Open In Colab

The guided workshop pins this preview and queries real public metadata. Its default run keeps image transfers off; optional samples use max_items. Report feedback through GitHub issues, including the failing operation, package/Python versions, and error message. Do not include credentials. Existing 3.x scripts should stay in a separate environment; see migration guidance.

The client requires Python 3.11 or newer and httpx. Notebook dependencies are in the tutorial requirements. The built wheel is the package used for notebook verification; an editable checkout is not required.

Provide the URL of a TCIA V2 REST host that has a ready installed bundle. The client does not choose a host or make a request during import or construction.

from tcia_utils import TCIAClient

with TCIAClient(base_url="https://tcia.duckdns.org") as tcia:
    service = tcia.status()
    page = tcia.search_datasets(query="lung", limit=10)
    for dataset in page.items:
        print(dataset["dataset_type"], dataset["short_title"], dataset.get("doi"))
    print(page.completeness.state, service.provenance.release_fingerprint)

Searches return one Page at a time. Call page.next_page() or iterate page.iter_pages() when more results are needed. Detail calls return a Result containing the service's named fields and notes. Both expose observed release provenance and completeness. partial means more cursor pages are available; unknown means the route has no exhaustive cursor or contains a bounded sublist. An empty successful page is a real zero-match result. Failures raise typed TCIAError subclasses: for example, ServiceUnavailableError for a missing capability or HTTP 503, HTTPResponseError for HTTP 500, and TransportError for a connection failure.

Collection search now returns data_categories directly from the shared service, without per-dataset enrichment calls. plan_downloads() consumes the shared REST/MCP download plan, including WordPress-derived software requirements and one software-help catalog. Runtime prerequisite checks remain in the Python client.

To plan and download a dataset from Python:

with TCIAClient(base_url="https://tcia.duckdns.org", pin_snapshot=True) as tcia:
    plan = tcia.plan_downloads("CMB-GEC")
    print(plan.to_dataframe()[["download_id", "download_category", "access_level"]])
    readiness = tcia.download_dataset("CMB-GEC", "downloads", dry_run=True)
    print(readiness.to_dataframe())  # Metadata and local prerequisite checks only.
    # Download public groups when ready (can be large):
    # After choosing a supported imaging download_id from plan:
    # report = tcia.download_dataset("CMB-GEC", "downloads",
    #     download_ids=[chosen_download_id], max_items=1, accept_data_policy=True)

Optional transfers delegate to tcia-data-retriever==0.1.0rc1, including its pip-bundled headless executable. tcia_utils[downloads] installs it; tcia_utils[cohorts] separately provides IDC metadata for public DICOM cohort queries. The SDK prepares exact, bounded selections and reports; TDR owns downloads, retries, verification, authorization and output layout. No separate Go/desktop installation is needed. Aspera groups remain external-only. See the download guide for policy acceptance, credential-cache behavior and current interface limits.

Use the task-oriented guide for methods, evidence scope, selection exports, and tool handoffs. The migration guide explains the 3.x API change; troubleshooting covers setup and response errors. The canonical guided workshop teaches dataset discovery/download planning, participant cohorts, brain MR segmentations, and controlled CT/SEG access in one conversational lesson. It uses real public metadata by default; public image cells run bounded samples; controlled transfers remain opt-in. It shows download categories and uses package helpers for page collection, clinical enrichment, manifest saving, and direct Python downloads. Original slide packages need configured transfer software; indexed NIfTI paths still require their published package rather than an invented per-file URL.

This alpha is for community testing. The service compatibility review and notebook validation preserve dated verification and earlier failure history. The four original hosted-route failures were repaired and subsequently passed live checks. API availability, indexed coverage, and the active metadata snapshot can change; retain response provenance with research exports. Clinical summaries are derived metadata, and some routes are bounded rather than exhaustive.

Visible TCIA Collection and Analysis Result records establish dataset publication. DataCite metadata and publication metrics enrich those records but do not establish publication by themselves. Public metadata about controlled data does not grant payload access. For public DICOM series detail and viewer URLs, use idc-index directly. Selection export prepares route-specific manifests without transferring payloads. Explicit download_dataset() and download_files() calls perform transfers; public notebook samples run with max_items=1, while controlled examples require the reader's approved key and explicit selection.

TCIA data use remains subject to the TCIA Data Usage Policy.

Manifest paths and URLs

with TCIAClient(base_url="https://tcia.duckdns.org") as tcia:
    report = tcia.download_manifest("cohort.tcia", "downloads", dry_run=True)
    # When ready, omit dry_run to transfer the entire supported selection.
    # report = tcia.download_manifest("https://example.org/cohort.csv", "downloads", accept_data_policy=True)

Supported inputs are .tcia and CSV/TSV with exactly one route column: SeriesInstanceUID, imageUrl, or drs_uri. Keys are required for controlled DRS transfers. Public UID manifests are checked against the maintained imaging index before any payload starts; missing series are reported rather than silently skipped. The client handles parsing and transfer adapters internally. The REST service does not receive local manifests or credentials.

The new shared plan requires the unpublished query-service endpoint /v2/datasets/{short_title}/download-plan. An older service produces a clear upgrade message; the client does not silently copy the server's routing logic. Standalone download_manifest() does not need that endpoint. See the local review handoff.

To test a transfer or keep a demo small, pass max_items=1 to download_manifest(), download_dataset(), or download_files(). The report marks a sample and counts what was selected and omitted. The limit counts whole DICOM series/files, not bytes; original packages without file-level selection cannot be sampled. See the sample-download section of the v4 user guide.

Download preparation is visible immediately. Actual transfers require explicit accept_data_policy=True. resume=True requests TDR skip-existing behavior; normal copy can download existing files again. The current TDR wrapper always inherits console progress and may privately cache supplied controlled keys. Read the download guide before using credentials. No dependency is installed at runtime.

Metadata

Release files for tcia-utils 4.0.0a7

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

Source distribution (sdist)

Source distribution for tcia-utils 4.0.0a7
File Size Uploaded Provenance Actions
tcia_utils-4.0.0a7.tar.gz 136.8 kB With provenance Details for tcia_utils-4.0.0a7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tcia-utils 4.0.0a7
File Interpreter ABI Platform Actions
tcia_utils-4.0.0a7-py3-none-any.whl Python 3 none any Details for tcia_utils-4.0.0a7-py3-none-any.whl

Total release size: 186.6 kB

Release files / tcia_utils-4.0.0a7.tar.gz

Download URL tcia_utils-4.0.0a7.tar.gz
Size 136.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8025b65610226599bbeb5ab9d4d3fee2e44904aad2bad3961d7b45e0066791ff
BLAKE2b-256 checksum
How to use checksums
fc2dc736252cb997eda1533dd928a4a04bacff9b279b3cc897c1f4ff8878bd2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / tcia_utils-4.0.0a7-py3-none-any.whl

Download URL tcia_utils-4.0.0a7-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86fcd484f3efaa169f3a93198a52d798172057e169ef196271459f5bb8cf8845
BLAKE2b-256 checksum
How to use checksums
7b4a73171c9219ba5ac7f2014f9e6dc90da750f6d10a8344c9e18a7fa6a3d71c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for tcia-utils 4.0.0a7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tcia_utils-4.0.0a7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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