Skip to content

Instantly share code, notes, and snippets.

@zomglings
Created November 19, 2019 13:12
Show Gist options
  • Save zomglings/02321fb1408ab7635584e158487afc56 to your computer and use it in GitHub Desktop.
Save zomglings/02321fb1408ab7635584e158487afc56 to your computer and use it in GitHub Desktop.
# First, run:
# pip install simiotics
from simiotics.clients import SimioticsRESTClient
if __name__ == '__main__':
import json
import time
dataset_id = f'test-dataset-{int(time.time())}'
client = SimioticsRESTClient.from_env()
print(json.dumps(client.ping()))
print(json.dumps(client.datasets_list(offset=1, limit=1)))
print(json.dumps(
client.dataset_create(
id=dataset_id,
source_type='INTRINSIC',
uri='None',
description='Test'
)
))
print(json.dumps(client.dataset_get(dataset_id)))
sample = client.sample_create(dataset_id, 'test-sample', [{'key': 'role', 'value': 'test'}])
print(json.dumps(sample))
print(json.dumps(client.samples_list(dataset_id)))
new_attribute = client.sample_attribute_create(
sample['dataset_id'],
sample['id'],
'some-key',
'some-value',
)
print(json.dumps(new_attribute))
print(json.dumps(client.sample_get(sample['dataset_id'], sample['id'])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment