Stream API¶
V1Client¶
-
class
runeq.stream.
V1Client
(cfg: runeq.config.Config)¶ V1Client is a factory class. It holds configuration, which is used to initialize accessor classes for Stream V1 endpoints.
-
Accel
(**defaults) → runeq.stream.v1.Accel¶ Initialize an Accel accessor.
- Parameters
**defaults – Default query parameters
-
Event
(**defaults) → runeq.stream.v1.Event¶ Initialize an Event accessor.
- Parameters
**defaults – Default query parameters
-
HeartRate
(**defaults) → runeq.stream.v1.HeartRate¶ Initialize a HeartRate accessor.
- Parameters
**defaults – Default query parameters
-
LFP
(**defaults) → runeq.stream.v1.LFP¶ Initialize an LFP accessor.
- Parameters
**defaults – Default query parameters
-
ProbabilitySymptom
(**defaults) → runeq.stream.v1.ProbabilitySymptom¶ Initialize a ProbabilitySymptom accessor.
- Parameters
**defaults – Default query parameters
-
Rotation
(**defaults) → runeq.stream.v1.Rotation¶ Initialize a Rotation accessor.
- Parameters
**defaults – Default query parameters
-
Span
(**defaults) → runeq.stream.v1.Span¶ Initialize a Span accessor.
- Parameters
**defaults – Default query parameters
-
State
(**defaults) → runeq.stream.v1.State¶ Initialize a State accessor.
- Parameters
**defaults – Default query parameters
-
property
config
¶ Return configuration.
-
Accessors¶
Query data from the Rune Labs Stream API (V1).
Each resource that is exposed by the Stream API can be queried through an accessor class.
Accel¶
-
class
runeq.stream.v1.
Accel
(cfg: runeq.config.Config, **defaults)¶ Query accelerometry data streams.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property
Event¶
-
class
runeq.stream.v1.
Event
(cfg: runeq.config.Config, **defaults)¶ Query patient events.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
property
HeartRate¶
-
class
runeq.stream.v1.
HeartRate
(cfg: runeq.config.Config, **defaults)¶ Query heart rate data streams.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property
LFP¶
-
class
runeq.stream.v1.
LFP
(cfg: runeq.config.Config, **defaults)¶ Query local field potential (LFP) data streams.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property
ProbabilitySymptom¶
-
class
runeq.stream.v1.
ProbabilitySymptom
(cfg: runeq.config.Config, **defaults)¶ Query the probability of a symptom.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property
Rotation¶
-
class
runeq.stream.v1.
Rotation
(cfg: runeq.config.Config, **defaults)¶ Query rotation data streams.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property
Span¶
-
class
runeq.stream.v1.
Span
(cfg: runeq.config.Config, **defaults)¶ Query spans.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
property
State¶
-
class
runeq.stream.v1.
State
(cfg: runeq.config.Config, **defaults)¶ Query device state.
-
property
expr_availability
¶ Availability expression for this resource.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
get_csv_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s CSV endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Returns
requests.Response
-
get_json_response
(**params) → requests.models.Response¶ Make a GET request to the resource’s JSON endpoint.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis, for this request.
- Returns
requests.Response
-
iter_csv_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the CSV endpoint, using the availability expression. May not be supported for all resources.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_csv_text
(**params) → Generator[str, None, None]¶ Iterate over CSV text results, from the resource’s CSV endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
text body of each response.
- Raises
APIError – when a request fails
-
iter_json_availability
(**params) → Generator[dict, None, None]¶ Convenience method to query the JSON endpoint, using the availability expression. This may not be supported for all endpoints.
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
NotImplementedError – if the resource doesn’t support an availability query expression.
-
iter_json_data
(**params) → Generator[dict, None, None]¶ Iterate over results from the resource’s JSON endpoint.
Follows pagination to get a complete set of results, starting with the page specified in the page kwarg (or the first page, by default).
- Parameters
**params – Query parameters for the request. These override self.defaults, on a key-by-key basis.
- Yields
dict with the “result” from the JSON body of each response.
- Raises
APIError – when a request fails
-
points
(**params) → Generator[dict, None, None]¶ Iterate over points from CSV response, yielding dictionaries.
This may involve multiple requests to the CSV endpoint, to follow pagination.
- Parameters
**params – query parameters for the request(s). These override self.defaults on a key-by-key basis.
- Yields
dict – Keys are the headers from the CSV response. Values are converted to numeric types where applicable. If numpy is available, np.float64 is used.
-
property