Giter Site home page Giter Site logo

psquery's Introduction

Predictive Services Query Client (psquery)

This package allows you to query Turi Predictive Services.

Refer to https://turi.com/products/predictive-services/docs/userguide/connecting.html#psquery for detailed information regarding how to use this client.

This package only includes the config.py and query_client.py from the full Predictive Services client psclient.

Connecting

In order to connect, you need to know the query endpoint URL and your key. An API key or an admin key is sufficient to query the Predictive Services. An API key may have limitations on which endpoints it can query. Consult with your system administrator to obtain the appropriate key.

The psquery.connect function is used to connect to the service.:

import psquery
conn = psquery.connect(query_endpoint_URL, key_id)

Please consult the connect function documentation for details on alternative methods of specifying these parameters during connection.

Querying

Once you have connected, you can query by specifying the endpoint you want to query and the parameters. Keep in mind that your key must have sufficient privileges to access the endpoint. Admin keys can access all endpoints, but API keys must be specifically allowed by endpoint name.:

response = conn.query('add', 1, 2)

The response is a dict with the following keys and values.:

{u'node': u'...', u'uuid': u'...', u'version': 1, u'from_cache': False, u'model': u'add', u'response': 3}

Please see the query method documentation for more details.

Feedback

If the endpoint allows it, you can specify feedback::

conn.feedback(response['uuid'], success=True)

Please see the feedback method documentation for more details.

psquery's People

Contributors

jonathan-dato avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.