Module lunar.data.query
Sub-modules
lunar.data.query.query
Classes
class QueryClient (config: Config)
-
Client for BAP Data API (
/v1/query
).Example
import bap client = bap.client("query")
Ancestors
Methods
def get_query(self, dataset_id: str, attributes: List[str] = None, query: Dict[str, Any] = None, sort: Dict[str, int] = None, limit: int = 100, headers: Dict[str, Any] = {}) ‑> List[Dict[str, Any]]
-
Get a data result.
Args
- dataset_id: (str) Unique identifier of a dataset
- attributes: (optional) (dict) Attributes to get from datasets
- query: (optional) (dict) Query statement
- sort: (optional) (dict) Sort statement with int index {"Ascending": 1, "Descending": -1}
- limit: (optional) (int) Max number of items to get
- headers: (optional) (dict) Headers being sent to API server
Returns
list
Example
data = client.get_query( dataset_id="my_dataset", attributes=["f1", "f2"], query={"f1": 100}, sort={"f1": 1, "f2": -1}, limit=5 )
async def get_query_async(self, dataset_id: str, attributes: List[str] = None, query: Dict[str, Any] = None, sort: Dict[str, int] = None, limit: int = 100, headers: Dict[str, Any] = {}) ‑> List[Dict[str, Any]]
-
Get a data result (async).
Args
- dataset_id: (str) Unique identifier of a dataset
- attributes: (optional) (dict) Attributes to get from datasets
- query: (optional) (dict) Query statement
- sort: (optional) (dict) Sort statement with int index {"Ascending": 1, "Descending": -1}
- limit: (optional) (int) Max number of items to get
- headers: (optional) (dict) Headers being sent to API server
Returns
list
Example
data = await client.get_query_async( dataset_id="my_dataset", attributes=["f1", "f2"], query={"f1": 100}, sort={"f1": 1, "f2": -1}, limit=5 )