Skip to main content

CLI to programmatically upload WSI cases to TuroEducate

Project description

turoeducate-cli

Command-line tool for uploading WSI files to TuroEducate and creating cases programmatically. Each file's basename becomes the case title.

Install

pip install -e tools/turoeducate-cli

Requires Python 3.10+. The entry point turoeducate is registered as a console script.

Usage

Single file

turoeducate upload /path/to/case1.svs

You will be prompted for your email and password. The password is read via getpass (not echoed and not stored in shell history). The file is streamed directly to S3 via a presigned URL; the CLI never writes credentials to disk.

Bulk directory

turoeducate upload-dir /path/to/slides/
turoeducate upload-dir /path/to/slides/ --recursive
turoeducate upload-dir /path/to/slides/ --folder-id <existing-folder-uuid>

One login, N uploads. Non-WSI files in the directory are skipped automatically.

Common options

  • --email EMAIL — skip the email prompt (still prompts for password)
  • --title TEXT — (single-file only) override the case title
  • --folder-id UUID — drop the case(s) into an existing folder
  • --difficulty {easy,medium,hard} — default medium
  • --status {draft,published} — default draft
  • --visibility {private,institution,public} — default private
  • --base-url URL — default https://turoeducate.turocrates.ai

Supported WSI formats: .svs .tif .tiff .ndpi .scn .mrxs .bif

Behaviour

The CLI is fire-and-forget: it confirms the upload, creates the case, prints the URL, and exits. The server's DSA sync worker processes the tile pyramid asynchronously — the case will show "Processing" in the web UI until that completes (seconds to a few minutes depending on file size).

If a file fails during bulk upload, the error is printed and the remaining files still upload.

The file is streamed to S3 with a real Content-Length header (not chunked transfer encoding), so the upload matches the presigned URL's content-type;host signature.

Security

  • HTTPS is enforced. --base-url must start with https://. http:// is only permitted for localhost / 127.0.0.1 during local development.
  • No credentials persisted. Password is entered via getpass each run. The JWT is held in memory only, never written to disk or an environment variable.
  • Public API only. The CLI talks exclusively to the same HTTPS endpoints the web UI uses — no backend internals, no direct database or storage access.
  • Server-enforced limits apply. Login is rate-limited to 20/minute per IP; uploads respect your account's storage quota (413 Payload Too Large).

Exit codes

Code Meaning
0 Success
1 Runtime error (login failed, upload failed, case creation failed)
2 Usage error (bad arguments, non-WSI file, invalid base URL)

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

turoeducate_cli-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

turoeducate_cli-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: turoeducate_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for turoeducate_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e70e7e2c6656b39f1ae0c3a452a537606503266b337426331690dd54ac7a289a
MD5 0db6ff80c43f0e6ccc27d4d7079447a8
BLAKE2b-256 2a72df9504d9843fb02e06d54bf3b9b46ace416da0a67e593edbf7139fb6ca8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turoeducate_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 481bb726aaa04ec5238b2734f2093b4a2ad07c52b22b041b64a9ea9ebb674945
MD5 851c13baee6271ddf54e06d5b99eedb0
BLAKE2b-256 b236fe655fe1dbaccc7baa7210c0bbe74be0976b6c9decc9e40dc79c6a57fa55

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