pyRinexpro.client

Client

class pyRinexpro.Client(secret_key)

Bases: object

A client to the rinexpro api, it contain the api key and can make request to the api

Parameters:secret_key (str) – The api key
api_request(uri, params={}, method='get', files={}, parse_resp=True)

Make an HTTP request to the api

Parameters:
  • uri (str) – The url without host name
  • params (dict(str,object)) – The url parameters (default is {})
  • method (str) – The HTTP method, not case sensitive (default is ‘get’)
  • files (dict(str,file)) – Files to upload only with POST method (default is {})
  • parse_resp (bool) – Parse the response as a json file (default is True)
Returns:

The parsed json as a Python object or the HTTP content

Return type:

object or list(byte)

getSessions(status=None, before=None, after=None)

Get all sessions as a list

Example:

>>> sesssions = client.getSessions(after='20190521')
Parameters:
  • status (int or SessionStatus) – Filter sessions by status (default is None)
  • before (str or datetime) – Filter sessions by last_epoch (default is None)
  • after (str or datetime) – Filter sessions by last_epoch (default is None)
Returns:

All sessions found

Return type:

SessionList

exportSessions(path_or_buf=None)

Export the pdf report file

Parameters:path_or_buf (str or file) – The path or the file-like object to save the file (default is None)
Returns:The content of the file if save_to is ‘’ or self
Return type:list(byte) or None
getSession(id)

Get a session by id

Example:

>>> sesssion = client.getSession(12)
Parameters:id (int) – The id of the session
Returns:The session associated to the id
Return type:Session
getProcesses(algo=None, status=None, before=None, after=None)

Get all processes as a list

Example:

>>> processes = client.getProcesses(algo='diff', status=PROC_SUCCESS)
Parameters:
  • algo (str) – Filter processes by algo (default is None)
  • status (int or SessionStatus) – Filter processes by status (default is None)
  • before (str or datetime) – Filter processes by last_epoch (default is None)
  • after (str or datetime) – Filter processes by last_epoch (default is None)
Returns:

All processes found

Return type:

ProcessList

exportProcesses(path_or_buf=None)

Export the pdf report file

Parameters:path_or_buf (str or file) – The path or the file-like object to save the file (default is None)
Returns:The content of the file if save_to is ‘’ or self
Return type:list(byte) or None
getProcess(id)

Get a process by id

Example:

>>> process = client.getProcess(24)
Parameters:id (int) – The id of the process
Returns:The process associated to the id
Return type:Process
uploadSession(sess_file=None, link=None, antenna_height=None, format=None, wait=False, refresh_rate=10, wait_retry='ask')

Create a session by uploading a file

Example:

>>> sesssion = client.uploadSession(link="https://my-sessions-files/session-3")
Parameters:
  • sess_file (str or file) – The file location or file-like object (default is None)
  • link (str) – The file url (default is None)
  • antenna_height (float) – The antenna height (default is None)
  • format (str) – The file format (default is None)
  • wait (bool) – Wait for the process to finish (default is None)
  • refresh_rate (int) – The time in second between each update, used when wait is True (default is 10)
  • wait_retry (str) – Should it wait for the preprocessing to retry (default is ask)
Returns:

The created session

Return type:

Session

virtualSession(*args, wait=False, refresh_rate=10, **kwargs)

Create a virtual session

Example:

>>> sesssion = client.virtualSession('MYVRS', 64.03, 12.91, "2019-01-21 12:33:05",
                                     "2019-01-21 15:15:35", 30)
Parameters:
  • *args – ParamsVrs or same parameters as ParamsVrs.__init__()
  • wait (bool) – wait for the process to finish (default is None)
  • refresh_rate (int) – The time in second between each update, used when wait is True (default is 10)
  • **kargs – Same parameters as ParamsVrs.__init__()
Returns:

The created session

Return type:

Session

geoRef(sess_file=None, link=None, antenna_height=None, format=None, params=None, refresh_rate=10, wait_retry='yes', **kwargs)

Upload a session, launch a diff process and get the result

Example:

>>> log = client.geoRef('my-session-file', mode='static', n=4)
Parameters:
  • sess_file (str or file) – The file location or file-like object (default is None)
  • link (str) – The file url (default is None)
  • antenna_height (float) – The antenna height (default is None)
  • format (str) – The file format (default is None)
  • params (ParamsDiff) – The parameters of the algorithm (default is None)
  • refresh_rate (int) – The time in second between each update (default is 10)
  • wait_retry (str) – Should it wait for the preprocessing to retry (default is ask)
  • **kwarg – The same parameters ParamsDiff.__init__(), used when params is None
Returns:

return LogDiff on success

Return type:

LogDiff, Process, Session

ppp(sess_file=None, link=None, antenna_height=None, format=None, params=None, refresh_rate=10, wait_retry='yes', **kwargs)

Upload a session, launch a ppp process and get the result

Example:

>>> log = client.ppp('my-session-file', mode='kinematic')
Parameters:
  • sess_file (str or file) – The file location or file-like object (default is None)
  • link (str) – The file url (default is None)
  • antenna_height (float) – The antenna height (default is None)
  • format (str) – The file format (default is None)
  • params (ParamsDiff) – The parameters of the algorithm (default is None)
  • refresh_rate (int) – The time in second between each update (default is 10)
  • wait_retry (str) – Should it wait for the preprocessing to retry (default is ask)
  • **kwarg – The same parameters ParamsDiff.__init__(), used when params is None
Returns:

return LogPPP on success

Return type:

LogPPP, Process, Session

vrs(*args, refresh_rate=10, save_to='', **kwargs)

Create a VRS, save the Obs file and get the log

Example:

>>> log = client.vrs('my-session-file', 'MYVRS', 64.03, 12.91, "2019-01-21 12:33:05",
                     "2019-01-21 15:15:35", 30, save_to='new_obs_file')
Parameters:
  • *args – The virtualSession parameters
  • refresh_rate (int) – The time in second between each update (default is 10)
  • save_to (str) – The path to save the obs file (default is ‘’)
  • **kwargs – The virtualSession parameters

ErrorAPI

exception pyRinexpro.ErrorAPI(value)

Bases: Exception

The execption used when api return an error