Skip to main content

Python SDK for the ZiCON Cloud API

Project description

zicon-cloud

Python SDK for the ZiCON Cloud API.

Installation

pip install zicon-cloud

Quickstart

from zicon_cloud import ZiconClient

# Public endpoints work without an API key
client = ZiconClient()

# Authenticated endpoints require an api_key
client = ZiconClient(api_key="YOUR_ZICON_API_KEY")

Usage

List datasets (no auth required)

from zicon_cloud import ZiconClient

client = ZiconClient()
datasets = client.list_datasets()
print(datasets)

Get a single dataset (no auth required)

dataset = client.get_dataset("dataset-id")
print(dataset)

List projects (requires API key)

from zicon_cloud import ZiconClient

client = ZiconClient(api_key="YOUR_ZICON_API_KEY")
projects = client.list_projects()
print(projects)

Get files for a project (requires API key)

files = client.get_project_files("project-id")
print(files)

Get a file download URL (requires API key)

download_url = client.get_download_url("file-id")
print(download_url)

Error handling

The SDK raises typed exceptions based on the API response:

from zicon_cloud import (
    ZiconClient,
    ZiconAuthError,
    ZiconPermissionError,
    ZiconNotFoundError,
    ZiconServerError,
)

client = ZiconClient(api_key="YOUR_ZICON_API_KEY")

try:
    projects = client.list_projects()
except ZiconAuthError:
    print("Invalid or missing API key")
except ZiconPermissionError:
    print("Your API key doesn't have permission for this")
except ZiconNotFoundError:
    print("Resource not found")
except ZiconServerError:
    print("ZiCON Cloud is having server issues, try again later")

Calling an authenticated method (list_projects, get_project_files, get_download_url) without an api_key set on the client raises ZiconAuthError immediately, without making a network request.

Development

pip install -e ".[test]"
pytest

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

zicon_cloud-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

zicon_cloud-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zicon_cloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cb3559efd4154a68a1fe7a7cd2680749bfad252c9e467a92e7d731da64891767
MD5 afa8ac0a8451018094ce8b7a19bcb1e0
BLAKE2b-256 77a087f8fb32713dad8ba6030a2315c323d27fbd4108efa4b40331de09050fc5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zicon_cloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for zicon_cloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b239b49b9edb327bc4b1efca7a98838a95a45247a5cd3c1f6c2794e3e51e28e
MD5 3d44828b4463df8d8ead34c3971c6e72
BLAKE2b-256 d070260aca25f61058b182eed6d4eacc0f5bc864b6cf97ac724a453dda285551

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