Skip to main content

Python client for the grand-challenge.org API

Project description

Grand Challenge API Client

https://img.shields.io/pypi/v/gcapi.svg Build Status Code Coverage Status Documentation Status

Python client for the grand-challenge.org API

Features

This client library is a handy way to interact with the REST API for grand-challenge.org from python, and provides some convenience methods.

Uploading Files to Archives, Algorithms or Reader Studies

You will need to get an API token, and find the slug of the object you want to upload to.

First, you will need to authorise the client using your personal API token.

from gcapi import Client

c = Client(token="Your Personal API Token")

Then, prepare the list of files for each image you want to upload.

from pathlib import Path

files = [f.resolve() for f in Path("/path/to/files").iterdir()]

Now, you can upload these files to an Archive, Algorithm or Reader Study which are identified by a slug. For instance, if you would like to upload to the algorithm at https://grand-challenge.org/algorithms/corads-ai/ you would use algorithm="corads-ai". Note that this is case sensitive.

Now you can start the upload.

session = c.upload_cases(files=files, algorithm="corads-ai")

You can change algorithm for archive or reader_study there.

You will get a session that starts the conversion of the files, and then adds the standardised images to the selected object once it has succeeded. You can refresh the session object with

session = c(url=session["api_url"])

and check the session status with session["status"].

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.3.0 (2020-12-02)

  • Breaking Changes in upload_cases:
    • Renamed kwarg files_to_upload to files

    • algorithm kwarg now takes a slug rather than a title

    • Removed run_external_algorithm, use upload_cases instead

  • Add Multiple 2D bounding box question types to reader studies

0.2.9 (2020-09-29)

  • Add support for ETDRS grid annotation endpoints

0.2.8 (2020-06-05)

  • Skip validation of PATCH requests

0.2.7 (2020-05-16)

  • Fixed reader study detail lookups

0.2.6 (2020-05-15)

  • Note: this release has been yanked from pypi

  • Added support for retina polygon annotation sets and retina single polygon annotations

  • If authentication token is unset, the GRAND_CHALLENGE_AUTHORIZATION will be used as a fallback

0.2.5 (2020-04-24)

  • Allow null answers

0.2.4 (2020-04-03)

  • Added GET request params

0.2.3 (2020-03-26)

  • Added ground truth endpoint for reader studies

0.2.2 (2020-03-24)

  • Added support for uploading to archives and reader studies

0.2.1 (2020-03-23)

  • Added Polygon and Choice question types to reader studies

0.2.0 (2020-02-09)

  • Dropped Python 2.7 and 3.5

  • Added support for Python 3.7 and 3.8

0.1.0 (2019-05-07)

  • First release on PyPI.

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

gcapi-0.3.0.tar.gz (132.1 kB view details)

Uploaded Source

Built Distribution

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

gcapi-0.3.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file gcapi-0.3.0.tar.gz.

File metadata

  • Download URL: gcapi-0.3.0.tar.gz
  • Upload date:
  • Size: 132.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for gcapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5f896481c7309549926b0ce116fc507650bb7f99732e01b90c4d475b565d2586
MD5 36baf111883e0f53d75eeca59bc2fdda
BLAKE2b-256 44d3f57a882d0109d576ca74222d992428b5401207d23ad4f83a0c7b7f380fe1

See more details on using hashes here.

File details

Details for the file gcapi-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gcapi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for gcapi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 568d6626d32b69dd8a701ed10eadab9764df948da724d5c5001e4b6853484215
MD5 cce3239ce76e1d08d7c17ef0cf44917b
BLAKE2b-256 909c959804825a1e5829225c1d523f0b92abcf1c34b76d86a6e96e12de7bc0a0

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