RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
RappCloud.RappPlatformApi.RappPlatformAPI Class Reference

Public Member Functions

def __init__
 
def cognitiveExerciseSelect
 Cognitive Exercise selection (chooser) API service call. More...
 
def cognitiveGetHistory
 Gognitive get history records API service call. More...
 
def cognitiveGetScores
 Gognitive get score records API service call. More...
 
def cognitiveRecordPerformance
 Gognitive record performance of an exercise API service call. More...
 
def emailFetch
 Email fetch API service call. More...
 
def emailSend
 Email fetch API service call. More...
 
def faceDetection
 Face detection API service call. More...
 
def geolocation
 Geolocation API service call. More...
 
def hazardDetectionDoor
 Hazard detection door check API service call. More...
 
def hazardDetectionLights
 Hazard detection light check API service call. More...
 
def humanDetection
 Human detection API service call. More...
 
def newsExplore
 News Explorer API service call. More...
 
def objectRecognitionCaffe
 Object Recognition Caffe API service call. More...
 
def ontologyIsSubsuperclass
 Ontology is-supsuperclass-of API service call. More...
 
def ontologySubclasses
 Ontology subclasses-of API service call. More...
 
def ontologySuperclasses
 Ontology superclasses-of API service call. More...
 
def pathPlanningPlan2D
 Path planning plan path 2D API service call. More...
 
def pathPlanningUploadMap
 Path planning upload map API service call. More...
 
def qrDetection
 QR code detection API service call. More...
 
def setNoiseProfile
 Set Noise Profile API service call. More...
 
def speechRecognitionGoogle
 Speech recognition Google API service call. More...
 
def speechRecognitionSphinx
 Speech recognition Sphinx API service call. More...
 
def textToSpeech
 Text to Speech API service call. More...
 
def weatherReportCurrent
 Weather report current API service call. More...
 
def weatherReportForecast
 Weather report forecast API service call. More...
 

Public Attributes

 svc_caller
 

Detailed Description

RAPP Platform simple API implementation 

Definition at line 57 of file RappPlatformApi.py.

Constructor & Destructor Documentation

def RappCloud.RappPlatformApi.RappPlatformAPI.__init__ (   self)

Definition at line 59 of file RappPlatformApi.py.

Member Function Documentation

def RappCloud.RappPlatformApi.RappPlatformAPI.cognitiveExerciseSelect (   self,
  test_type = '',
  test_subtype = '',
  test_diff = -1,
  test_index = -1 
)

Cognitive Exercise selection (chooser) API service call.

test_type: string

Parameters
test_typeCognitive Exercise test type. Defaults to empty.

test_subtype: string

Parameters
test_subtypeForce exercise selection from this subtype. Defaults to empty.

test_diff: int

Parameters
test_diffForce exercise selection from this difficulty. Defaults to empty.

test_index: int

Parameters
test_diffForce exercise selection from this difficulty. Defaults to empty.

: dict

Returns
: Returns a dictionary of the service call response.

Definition at line 373 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.cognitiveGetHistory (   self,
  test_type = '',
  time_from = 0,
  time_to = 0 
)

Gognitive get history records API service call.

test_type: string

Parameters
test_typeCognitive Exercise test type. Defaults to empty.

time_from: int

Parameters
time_fromRetrieve history records from this timestamp value. Unix timestamp. Defaults to zero (0).

time_to: int

Parameters
time_fromRetrieve history records up to this timestamp value. Unix timestamp. Defaults to zero (0).

: dict

Returns
: Returns a dictionary of the service call response. {'records': {}, 'error': ''}

Definition at line 415 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.cognitiveGetScores (   self,
  test_type = '',
  time_to = 0 
)

Gognitive get score records API service call.

test_type: string

Parameters
test_typeCognitive Exercise test type. Defaults to empty.

time_to: int

Parameters
time_fromRetrieve score records up to this timestamp value. Unix timestamp. Defaults to zero (0).

: dict

Returns
: Returns a dictionary of the service call response. {'test_classes': [], 'scores': [], 'error': ''}

Definition at line 446 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.cognitiveRecordPerformance (   self,
  test_instance,
  score 
)

Gognitive record performance of an exercise API service call.

test_instance: string

Parameters
test_instancePerformed cognitive exercise test instance. The full cognitive test entry name as obtained from CognitiveExerciseSelect API service call

: dict

Returns
: Returns a dictionary of the service call response. {'performance_entry': '', 'error': ''}

Definition at line 473 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.emailFetch (   self,
  email,
  password,
  server,
  port,
  date_from,
  date_to,
  email_status = 'UNSEEN',
  num_emails = 1 
)

Email fetch API service call.

email: string

Parameters
emailUser's email username

password: string

Parameters
passwordUser's email password

server: string

Parameters
serverThe email provider imap address.

port: string

Parameters
portThe email provider imap port.

date_from: int

Parameters
date_fromFetch emails since this timestamp value. Unix timestamp.

date_to: int

Parameters
date_toFetch emails up to this timestamp value. Unix timestamp.

email_status: string

Parameters
email_statusEmail status (ALL, UNSEEN). Defaults to 'UNSEEN'

num_emails: int

Parameters
num_emailsMaximum number of emails to fetch.

: dict

Returns
: Returns a dictionary of the service call response. {'emails': [], 'error': ''}

Definition at line 498 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.emailSend (   self,
  email,
  password,
  server,
  port,
  recipients,
  body,
  subject,
  attach_file = '' 
)

Email fetch API service call.

email: string

Parameters
emailUser's email username

password: string

Parameters
passwordUser's email password

server: string

Parameters
serverThe email provider imap address.

port: string

Parameters
portThe email provider imap port.

recipients: list

Parameters
recipientsList of recipients email addresses.

body: string

Parameters
bodyThe body of the email.

subject: string

Parameters
subjectThe email subject.

attach_file: string

Parameters
attach_fileAttachment file (path). Attachment file can be a .zip file containing multiple attachment files for the email to send

: dict

Returns
: Returns a dictionary of the service call response. {'error': ''}

Definition at line 550 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.faceDetection (   self,
  imageFilepath,
  fast = False 
)

Face detection API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

fast: bool

Parameters
fastPerform fast detection. If true, detection will take less time but it will be less accurate.

: dict

Returns
: Returns a dictionary of the service call response. {'faces': [], 'error': ''}

Definition at line 62 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.geolocation (   self,
  ipaddr,
  engine = 'ip-api' 
)

Geolocation API service call.

ipaddr: string

Parameters
ipaddrThe machine's ipv4 address.

engine: string

Parameters
engineEngine to use. Defaults to 'ip-api'.

: dict

Returns
: Returns a dictionary of the service call response.

Definition at line 810 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.hazardDetectionDoor (   self,
  imageFilepath 
)

Hazard detection door check API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

: dict

Returns
: Returns a dictionary of the service call response. {'door_angle': 0.0, 'error': ''}

Definition at line 131 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.hazardDetectionLights (   self,
  imageFilepath 
)

Hazard detection light check API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

: dict

Returns
: Returns a dictionary of the service call response. {'light_level': 0, 'error': ''}

Definition at line 152 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.humanDetection (   self,
  imageFilepath 
)

Human detection API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

: dict

Returns
: Returns a dictionary of the service call response. {'humans': [], 'error': ''}

Definition at line 109 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.newsExplore (   self,
  keywords,
  region = '',
  topic = '',
  news_engine = '',
  num_news = 1,
  exclude_titles = [] 
)

News Explorer API service call.

keywords: list

Parameters
keywordsDesired keywords.

region: string

Parameters
regionlanguage/region

topic: string

Parameters
topicMain topic. e.g. 'sports', 'politics', etc

news_engine: string

Parameters
news_engineThe news search engine to use. Optional

num_news: string

Parameters
num_newsNumber of news stories to request.

exclude_titles: list

Parameters
exclude_titlesExclude these titles

: dict

Returns
: Returns a dictionary of the service call response. {'news_stories': [], 'error': ''}

Definition at line 769 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.objectRecognitionCaffe (   self,
  imageFilepath 
)

Object Recognition Caffe API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

: dict

Returns
: Returns a dictionary of the service call response. {'object_class': '', 'error': ''}

Definition at line 173 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.ontologyIsSubsuperclass (   self,
  parent_class,
  child_class,
  recursive = False 
)

Ontology is-supsuperclass-of API service call.

parent_class: string

Parameters
parent_classThe ontology parent class name.

child_class: string

Parameters
child_classThe ontology child class name.

recursive: bool

Parameters
recursiveRecursive search. Defaults to False.

: dict

Returns
: Returns a dictionary of the service call response. {'result': False, 'error': ''}

Definition at line 343 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.ontologySubclasses (   self,
  ontology_class,
  recursive = False 
)

Ontology subclasses-of API service call.

ontology_class: string

Parameters
ontology_classThe ontology class.

recursive: bool

Parameters
recursiveRecursive search. Defaults to False.

: dict

Returns
: Returns a dictionary of the service call response. {'results': [], 'error': ''}

Definition at line 293 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.ontologySuperclasses (   self,
  ontology_class,
  recursive = False 
)

Ontology superclasses-of API service call.

ontology_class: string

Parameters
ontology_classThe ontology class.

recursive: bool

Parameters
recursiveRecursive search. Defaults to False.

: dict

Returns
: Returns a dictionary of the service call response. {'results': [], 'error': ''}

Definition at line 318 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.pathPlanningPlan2D (   self,
  map_name,
  robot_type,
  pose_start,
  pose_goal,
  algorithm = 'dijkstra' 
)

Path planning plan path 2D API service call.

map_name: string

Parameters
map_nameThe map name.

robot_type: string

Parameters
robot_typeThe robot type. e.g 'NAO'

pose_start: dict

Parameters
pose_startStart pose of the robot.

pose_goal: dict

Parameters
pose_goalGoal pose of the robot.

algorithm: string

Parameters
algorithmPath planning algorithm to apply. Defaults to 'dijkstra'

: dict

Returns
: Returns a dictionary of the service call response. {'plan_found': 0, 'path': [], 'error': ''}

Definition at line 670 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.pathPlanningUploadMap (   self,
  map_name,
  png_file,
  yaml_file 
)

Path planning upload map API service call.

map_name: string

Parameters
map_nameThe map name

png_file: string

Parameters
png_filePath to the map png file

yaml_file: string

Parameters
yaml_filePath to the map descriptor yaml file.

: dict

Returns
: Returns a dictionary of the service call response. {'error': ''}

Definition at line 710 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.qrDetection (   self,
  imageFilepath 
)

QR code detection API service call.

imageFilepath: string

Parameters
imageFilepathPath to the image file.

: dict

Returns
: Returns a dictionary of the service call response. {'qr_centers': [], 'qr_messages': [], 'error': ''}

Definition at line 87 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.setNoiseProfile (   self,
  audiofile,
  audio_source 
)

Set Noise Profile API service call.

audiofile: string

Parameters
audiofilePath to the audio file.

audio_source: string

Parameters
audio_sourceAudio source format. e.g. 'nao_wav_1_ch'

: dict

Returns
: Returns a dictionary of the service call response. {'error': ''}

Definition at line 194 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.speechRecognitionGoogle (   self,
  audiofile,
  audio_source,
  language 
)

Speech recognition Google API service call.

audiofile: string

Parameters
audiofilePath to the audio file.

audio_source: string

Parameters
audio_sourceAudio source format. e.g. 'nao_wav_1_ch'

language: string

Parameters
languageLanguage to use for speech recognition.

: dict

Returns
: Returns a dictionary of the service call response. {'words': [], 'alternatives': [], 'error': ''}

Definition at line 263 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.speechRecognitionSphinx (   self,
  audiofile,
  audio_source,
  language,
  words,
  sentences = [],
  grammar = [] 
)

Speech recognition Sphinx API service call.

audiofile: string

Parameters
audiofilePath to the audio file.

audio_source: string

Parameters
audio_sourceAudio source format. e.g. 'nao_wav_1_ch'

language: string

Parameters
languageLanguage to use for speech recognition.

words: list

Parameters
wordsTo recognize words.

sentences: list

Parameters
sentencesUnder consideration sentences. Same as words by default.

grammar: list

Parameters
grammarGrammar to use. Defaults to none.

: dict

Returns
: Returns a dictionary of the service call response. {'words': [], 'error': ''}

Definition at line 219 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.textToSpeech (   self,
  text,
  language,
  audio_file 
)

Text to Speech API service call.

text: string

Parameters
textInput text to translate to audio.

language: string

Parameters
languageText language.

audio_file: string

Parameters
audio_fileFile path to store the audio data.

: dict

Returns
: Returns a dictionary of the service call response. {'error': ''}

Definition at line 738 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.weatherReportCurrent (   self,
  city,
  weather_reporter = 'forecast.io',
  metric = 0 
)

Weather report current API service call.

city: string

Parameters
cityCity location.

weather_reporter: string

Parameters
weather_reporterThe weather reporter API to use. Defaults to 'forecast.io'

metric: int

Parameters
metricValue units (0:Celcius, 1:Fahrenheit) Defaults to 0 (Celcius)

: dict

Returns
: Returns a dictionary of the service call response.

Definition at line 600 of file RappPlatformApi.py.

def RappCloud.RappPlatformApi.RappPlatformAPI.weatherReportForecast (   self,
  city,
  weather_reporter = 'forecast.io',
  metric = 0 
)

Weather report forecast API service call.

city: string

Parameters
cityCity location.

weather_reporter: string

Parameters
weather_reporterThe weather reporter API to use. Defaults to 'forecast.io'

metric: int

Parameters
metricValue units (0:Celcius, 1:Fahrenheit) Defaults to 0 (Celcius)

: dict

Returns
: Returns a dictionary of the service call response.

Definition at line 639 of file RappPlatformApi.py.

Member Data Documentation

RappCloud.RappPlatformApi.RappPlatformAPI.svc_caller

Definition at line 60 of file RappPlatformApi.py.


The documentation for this class was generated from the following file: