ws Package

ws Package

@package eWRT.ws Web Service access.

class eWRT.ws.AbstractIterableWebSource[source]

Bases: eWRT.ws.AbstractWebSource

web source implementing several calls to the API iterating over search terms and over API-specific maximal number of results restriction

DEFAULT_COMMAND = None
DEFAULT_FORMAT = None
DEFAULT_MAX_RESULTS = None
DEFAULT_START_INDEX = None
RESULT_PATH = None
invoke_iterator(search_terms, max_results, from_date=None, to_date=None, command=None, output_format=None)[source]

iterator: iterates over search terms and API requests

process_output(results, path)[source]

results’ post-processor: iterates over the API responses and calls the output convertor

request(search_term, current_index, max_results, from_date=None, to_date=None, command=None, output_format=None)[source]

calls the web source’s API

search_documents(search_terms, max_results=None, from_date=None, to_date=None, **kwargs)[source]

calls iterator and results’ post-processor

class eWRT.ws.AbstractWebSource[source]

Bases: object

a raw Web Source object

MAPPING = None
NAME = None
SUPPORTED_PARAMS = None

override this function to perform post-run tasks

override this function to perform pre-run tasks

search_documents(search_terms, max_results=None, from_date=None, to_date=None, **kwargs)[source]

runs the actual search / calls the webservice / API ...

TagInfoService Module

class eWRT.ws.TagInfoService.TagInfoService[source]

Bases: object

Class for fetching assigned tags

getRelatedTags(tags, retrieveTagInfo=False)[source]

returns a the count of related tags @param list/tuple of tags @param retrieveTagInfo determines whether we will retrieve the tagInfo for the related tags @returns list of related tags with a count of their occurence

getTagInfo(tags)[source]

returns the count for the given tags @param list/tuple of tags @returns number of counts

WebDataSource Module

class eWRT.ws.WebDataSource.WebDataSource[source]

Bases: object

A WebDataSource performs search queries against Web Sources such as Youtube, Twitter, ...

search(search_terms)[source]

returns the count for the given tags @param search_terms: a list of search terms @returns a list of matching documents