analysisstore.client package

Submodules

analysisstore.client.asutils module

analysisstore.client.asutils.doc_or_uid_to_uid(doc_or_uid)

Given Document or uid return the uid Parameters ———- doc_or_uid : dict or str

If str, then assume uid and pass through, if not, return the ‘uid’ field
uid
: str
A string version of the uid of the given document
analysisstore.client.asutils.get_document(url, doc_type, as_json, contents)
analysisstore.client.asutils.post_document(url, contents)
analysisstore.client.asutils.read_from_json(filename)
analysisstore.client.asutils.write_to_json(payload, filename)

analysisstore.client.commands module

class analysisstore.client.commands.AnalysisClient(config)

Bases: object

Client used to pass messages between analysisstore server and apps

aheader_url

URL for analysis header handler

atail_url

URL for analysis tail handler

connection_status()

Returns the connection status

bool
Returns True if connected
tornado.web.HTTPError
Raises 404 if no server to be found
True
True if connected to a tornado server
False
False if no tornado server found
dref_header_url

URL for data reference header handler

dref_url

URL for data reference handler

find(doc_type, query)

Given document type and search parameters, query the database and return docs that match the criteria. This is provided as a convenience routine. Instead of using find_*, one can use this routine.

doc_type
: str
Document type query will be performed on

query : dict

list
The outcome of the query performed against the Mongo daemon
find_analysis_header(**kwargs)

Given a set of parameters, return analysis header(s) that match the provided criteria

find_analysis_tail(**kwargs)

Given a set of parameters, return analysis tail(s) that match the provided criteria

find_data_reference(**kwargs)

Given a set of parameters, return data reference(s) that match the provided criteria

find_data_reference_header(**kwargs)

Given a set of parameters, return data reference header(s) that match the provided criteria

get(url, query)

Gets data to the server. For query operations Parameters ———- url : str

The address of the post
query
: dict
A special signature and data for this service
requests.HTTPError
In case get fails (status_code != 200)
insert(doc_type, **kwargs)
insert_analysis_header(uid, time, provenance, **kwargs)

Create the entry point for data analysis.

uid
: str
Unique identifier for analysis_header document
time
: float
Time entry created. If not filled, server assigns a timestamp
provenance
: dict
Provenance information for this data analysis to be recorded
kwargs
: dict
Additional fields.
uid
: str
uid of the document inserted
insert_analysis_tail(analysis_header, uid, time, exit_status, **kwargs)

Create the exit point for data analysis.

analysis_header
: str, doct.Document
Foreign key for the analysis_header this tail points to
uid
: str
Unique identifier for analysis_tail document.
time
: float
Time entry created. If not filled, server assigns a timestamp.
exit_status
: str
String indicator for data analysis.
kwargs
: dict
Additional fields.
uid
: str
uid of the document inserted
insert_bulk_data_reference(data_header, data, chunk_size=500, **kwargs)
insert_data_reference(data_header, uid, time, data, timestamps, **kwargs)

Create data reference document Parameters ———- data_header : doct.Document or uid

data_reference_header document this tail points to. Foreign key to the data_reference_header.
uid
: str
Unique identifier for data_reference document
time
: float
Time document was created. Server fills up this field if not provided
kwargs
: dict
Additional fields
uid
: str
uid of the inserted document
insert_data_reference_header(analysis_header, uid, time, data_keys, **kwargs)

Create data reference header document Parameters ———- analysis_header : doct.Document or uid

analysis_header document this tail points to. Foreign key to the analysis_header.
uid
: str
Unique identifier for data_reference_header document.
time
: float
Time document was created. Server fills up this field if not provided
kwargs
: dict
Additional fields
res
: str
uid of the inserted document
post(url, params)

Posts data to the server. For insert operations Parameters ———- url : str

The address of the post
params
: dict
A special signature and data for this service
requests.HTTPError
In case post fails (status_code != 200)
update_analysis_header(query, update)

Not yet implemented

update_analysis_tail(query, update)

Not yet implemented

Module contents