Skip to main content

Python client library for ZettaBlock AI Network

Project description

Python client for ZettaBlock AI Network.

Development

Setup

Install locally

  1. Clone the repository.
  2. Create a virtual environment and install the package.
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

GRPC

The client import zetta-grpc-protos as an external repo, you will need to provide your github username and password to install

# using below command to store and skip the repeatly input username / password
git config credential.helper store

For two phase authentication enabled account, password is private-access-token.

IDE setup

for PyCharm, you will need to run

pip install -e . 

to recognize the GRPC imported library correctly

Run the Client

Try run the client.

zetta --help

CICD

  1. the cicd is integrated with python 3.8 to 3.12 and on Ubuntu, MacOS and windows. make sure your PR passed all checks on all environment
  2. make sure some tests are added in the folder, cicd will run checks and test automatically
  3. if all tests passes, the version will be automatically boost and submit a newer version to PyPi
  4. If you want to include the comment in CHANGELOG.md, in Pull request, add ##Changelog in the comment

Examples of commands

datasets v2

upload parquets to create iceberg tables

zetta datasetsv2 create --namespace=ai-lake-test --dataset=imagenet-object-localization-challenge-dec03 --path=tests/data/

read and show datasets contents

(venv) cpei@Chengchengs-MacBook-Pro zetta-py-client % zetta datasetsv2 read --namespace=ai-lake-test --dataset=imagenet-object-localization-challenge-dec03 --limit=1
read ai-lake-test.imagenet-object-localization-challenge-dec03 limit = 1
                              id                                         image_data
0  ILSVRC2012_test_00090558.JPEG  b'/9j/4AAQSkZJRgABAQEASABIAAD/4gJASUNDX1BST0ZJ...

save datasets to local parquets

zetta datasetsv2 save --namespace=ai-lake-test --dataset=imagenet-object-localization-challenge-dec03

datasetsv2 ls

(venv) cpei@Chengchengs-MacBook-Pro zetta-py-client % zetta datasetsv2 ls --id=ai-network-worker-demo_imagenet-object-localization-challenge-dec06-1

(venv) cpei@Chengchengs-MacBook-Pro zetta-py-client % zetta datasetsv2 ls                                                                           
{
    "data": [
        {
            "id": "string_string",
            "name": "string",
            "data_source": "sdk",
            "region": "string",
            "bucket": "string",
            "path": "",
            "category": "string",
            "database": "string",
            "status": 0,
            "created_at": "2024-12-03T06:20:01.66634Z",
            "updated_at": "2024-12-03T06:20:01.66634Z",
            "tenant": "zettablock.com"
        }
    ],
    "error": ""
}

databasesv2

(venv) cpei@Chengchengs-MacBook-Pro zetta-py-client % zetta databasesv2 ls --database=testdb
{
    "data": {
        "id": 1,
        "name": "testdb",
        "catalog": "Awg",
        "region": ",
        "user": "AK",
        "pwd": "p",
        "bucket": "my-6k",
        "root": "athe",
        "workgroup": ""
    },
    "error": ""
}
(venv) cpei@Chengchengs-MacBook-Pro zetta-py-client % zetta databasesv2 ls                  
{
    "data": [
        {
            "id": 1,
            "name": "testdb",
            "catalog": "te",
            "region": "",
            "user": "AKIA",
            "pwd": "p",
            "bucket": "my-6k",
            "root": "",
            "workgroup": ""
        }
    ],
    "error": ""
}

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

zetta-0.0.100-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file zetta-0.0.100-py3-none-any.whl.

File metadata

  • Download URL: zetta-0.0.100-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for zetta-0.0.100-py3-none-any.whl
Algorithm Hash digest
SHA256 4b61f13160dee400b7f74705383b78c7be360a9e147bdbba1d77bce8078ad7eb
MD5 5f3174d853446c3dadfa01a1e0121f60
BLAKE2b-256 3ce798044bcec1d44ec575a576f53853c6d6641b65d4f0d484388a78d17b3d0c

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