TeselaGen/api-client

Multiomics example notebook slightly out of date

Closed this issue · 3 comments

I think the multiomics example notebook is out of sync with the lib. I fixed it by importing from teselagen.api.client import TeselaGenClient (which seems to be new) and then rewriting the auth code to look like this.

#host_url="https://your.teselagen.instance.com"
host_url="https://#############"
client = TeselaGenClient(host_url=host_url)
# The following command will promt you to type username (email) and password
client.login(username="##########", password='', apiKey='#############')
test_client = TESTClient(client)

Is that how it should be done? A lot of the rest of the notebook works (after replacing client with test_client), I only get a 502 at the point of uploading the data but that is probably unrelated to the lib.

@phantomas1234 you are right! Thank you for noticing this. We have recently updated the multiomics example to a newer version of the package: teselagen==0.3.2. You are right about the new way of importing the teselagen client:

# imports
import teselagen
from teselagen.api import TeselaGenClient
print("teselagen version: ", teselagen.__version__)

# logging in with an apiKey. 
# The apiKey can be obtained from the teselagen web application top right 'Settings > API Key'
client = TeselaGenClient(host_url='https://your.teselagen.instance.com')
client.login(username='####', apiKey='####')

test_client = client.test

This latter and more can also be found at the newer multiomics jupyter notebook example.

Let us know if its working for you. ;)

PyPi lib version teselagen==0.3.2 is working ok and also the master branch, however we just still need a proper tag in the repo.

Closed by: #18