A suite of tools for interacting with Zegami through Python.
Project description
Zegami Python SDK
zegami-python-sdk
An SDK and general wrapper for the lower level Zegami API for Python. This package provides higher level collection interaction and data retrieval.
Getting started
Grab this repo, open the script, and load an instance of ZegamiClient into a variable.
from zegami_client import ZegamiClient
zc = ZegamiClient(username, login)
Credentials
The client operates using a user token. By default, logging in once with a valid username/password will save the acquired token to your home directory as
zegami.token
. The next time you need to use ZegamiClient, you may call zc = ZegamiClient()
with no arguments, and it will look for this stored token.
Example Usage
Get the metadata and images associated with every dog of the 'beagle' breed in a collection of dogs:
zc = ZegamiClient()
# By default, the client will look for collections in your default workspace.
# You can manually provide another workspace ID to look there instead.
# Grab the collection (a dictionary of information)
dogs_collection = zc.get_collection_by_name('My dogs collection')
# Get a pandas.DataFrame of the data in the collection, filtering to only
# items whose 'Breed' column == 'beagle'
beagles = zc.get_rows_by_filter(dogs_collection, { 'Breed' : 'beagle' })
# Get the image URLs associated with these rows
beagles_urls = zc.get_image_urls(dogs_collection, beagles)
# Download those images (into memory)
beagles_imgs = zc.download_image_batch(beagles_urls)
In Development
This SDK is in active development, not all features are available yet. Creating/uploading to collections is not supported currently - check back soon!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for zegami_sdk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fcfefe6455c02f03824936721b6d6783d7f3d7476acbdde22844650462134b4 |
|
MD5 | d6075aa5c2535eed161347cf57719798 |
|
BLAKE2b-256 | d2a731635881e53d75e452af75677f8987b70c62b4d74ff76e975819dac6e85c |