Skip to main content

Lore IO sdk

Project description

#Lore IO python SDK

####Interactive shell:

python -m loreiosdk wss://ui.getlore.io/storyteller

More information here : https://loreio.atlassian.net/wiki/spaces/LD/pages/711720969/Spyglass+Interactive+Shell

####Scripting:

from loreiosdk.spyglass_script import Spyglass   

# get your spyglass instance
spyglass_instance = Spyglass('wss://ui.getlore.io/storyteller', 'USERNAME',
'PASSWORD', dataset_id='DATASET_ID')

# cmd will trigger an sync command and will return an JSON object containing the result    
# passing a keyword argument = None is the equivalent of passing --argument without any value in the shell
# result will always be in the following format:
# {'seqno': 0, 'message': 'the message from the b-e', 'data': {"Some json/array": 0}}
# based the command used, message and/or data can be None  
result = spyglass_instance.cmd("Command Name", "argument1", "argument2", Keyword_arg1=True, arg2=None)

# streaming_cmd will return a generator.
# Today it is only compatible with the "chart"
# result will be formatted like
for result in spyglass_instance.streaming_cmd('chart', 'chart_id', streaming=None):
   print result  

# async_cmd will trigger a none blocking command, allowing you to do something else
# and if you need the result later, you can use get_result_for_cmd with the seqno
# to get the status ('IN_PROGRESS' or 'DONE') and if done, the result of your command.
seqno = spyglass_instance.async_cmd("Command Name", "Positional_argument", Keyword_arg=1)
print "Do Something else"
status, result = spyglass_instance.get_result_for_cmd(seqno)

##Contributors resources

Build using:

update version in setup.py and __init__.py

python setup.py sdist bdist_wheel  

Publish using:

twine upload dist/loreio-sdk-VERSION.tar.gz

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

loreio-sdk-0.5.9.tar.gz (15.3 kB view details)

Uploaded Source

File details

Details for the file loreio-sdk-0.5.9.tar.gz.

File metadata

  • Download URL: loreio-sdk-0.5.9.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for loreio-sdk-0.5.9.tar.gz
Algorithm Hash digest
SHA256 fb5e2a5ecf726e87e6964a981e08316093d38bdbaf8fd94068da611d3b7e7bc4
MD5 91d5f74a5f340028a589f87e9f1c17f9
BLAKE2b-256 cfb959a0e325e9c1b0a33be178417fdd25da759f74dc4067f274cef5588f7b62

See more details on using hashes here.

Supported by

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