Skip to main content

No project description provided

Project description

Client for the Dorothy Image Server built using the requests library.


Index and Contents


Getting started

All JSONs returned by the API were serialized into Python objects to make server usage easier and more standardized among team members.

Authentication

To authenticate access to routes, it is necessary to obtain a token. The token can be provided by the admin members of the Dorothy server. Once the token has been obtained, it is possible to authenticate the client in 3 ways:

1. Passing the token directly as a parameter to the client

from doroty_client import Client

service = Client(token="Your token here")

2. Through environment variable

from doroty_client import Client
from os import environment

environment["DOROTYSDK_ACCESS_TOKEN"] = "your token here"


service = Client()

3. Through a text file

Create a txt file in a path of interest whose content is just your token.

from doroty_client import Client

service = Client(path="/path/to/the/file.txt")

Examples of use

Once the authentication is done, it is possible to perform the following tasks:

Search for an image

some_image = service.image("china_CHNCXR_0099_0_3D81FF")

Search for an dataset

dataset_china = service.dataset("china")

Listing images from a dataset

dataset_china = service.dataset("china")
images = dataset_china.list_images()

Downloading an image

some_image = service.image("china_CHNCXR_0099_0_3D81FF")
image_bytes = some_image.download_image()

This client was built based on the requests library. For any questions about its use, read the library documentation.

Development

For development, just clone the repository and create a virtual environment from the declared dependencies. Direct pushes to main branch are not allowed as main represents the most stable version of the client. Look to develop a feature on a new branch and then later open PR to the dev branch.

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

dorothy-sdk-1.4.3.tar.gz (19.8 kB view details)

Uploaded Source

File details

Details for the file dorothy-sdk-1.4.3.tar.gz.

File metadata

  • Download URL: dorothy-sdk-1.4.3.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dorothy-sdk-1.4.3.tar.gz
Algorithm Hash digest
SHA256 6e3cf756f6177c561bd7ca0eb0250c68476d8164b39ebd9c08e6372fd8b7a986
MD5 1f56a05eefb79ae7c9709573400fb218
BLAKE2b-256 780c6b3a7e8a6aed05deaebb1889485385e56da27b934f7f3af6d2f37290862a

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