Skip to main content

Python client for oka

Project description

test codecov

Client for OKA repository

Install

sudo apt install python3.8-venv python3.8-dev python3.8-distutils # For Debian-like systems.
git clone https://github.com/rabizao/oka.git
cd oka
python3.8 -m venv venv
source venv/bin/activate
pip install -e .

Usage

Transfering data

from oka import oka
from aiuna.step.dataset import dataset
import sys

from tatu.auth import gettoken

oka.url = "http://localhost:5000"
oka.token = gettoken(oka.url, *sys.argv[1:]) if len(sys.argv) == 3 else "no token yet"
data = dataset.data
did = data.id

# Object approach.
oka << data
d = oka(did)
print(d.uuid)
"""
Please login before.
Username to connect to OKA: 00ptEh8jeD4BOtwv0thXenF
"""
# Object "@" approach.
d = did @ oka
print(d.id)
"""
00ptEh8jeD4BOtwv0thXenF
"""
# Function approach.
from oka.io import send, get
send(data, url="http://localhost:5000")
d = get(did, url="http://localhost:5000")
print(d.uuid)
"""
[Error] You have already uploaded the dataset with OID 00ptEh8jeD4BOtwv0thXenF.
00ptEh8jeD4BOtwv0thXenF
"""

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

oka-0.2107.9.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

oka-0.2107.9-py3-none-any.whl (17.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page