Skip to content

Commit f043836

Browse files
committed
Rename Core to Client in Core
1 parent 9784fc6 commit f043836

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/obelisk/asynchronous/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This module contains the asynchronous API to interface with Obelisk CORE.
33
These methods all return a :class:`Awaitable`.
44
5-
Relevant entrance points are :class:`Core`.
5+
Relevant entrance points are :class:`Client`.
66
77
This API vaguely resembles that of clients to previous Obelisk versions,
88
but also significantly diverts from it where the underlying Obelisk CORE API does so.
@@ -159,7 +159,7 @@ class QueryResult(BaseModel):
159159
items: List[Datapoint]
160160

161161

162-
class Core(BaseClient):
162+
class Client(BaseClient):
163163
page_limit: int = 250
164164
"""How many datapoints to request per page in a cursored fetch"""
165165

src/obelisk/types/core.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
"""
2+
Types specific to Obelisk CORE, including an RSQL filter implementation
3+
4+
To create a filter, look at :class:`Filter`.
5+
Example:
6+
7+
>>> from datetime import datetime
8+
>>> f = (Filter().add_and(
9+
... Comparison.equal('source', 'test source'),
10+
... Comparison.is_in('metricType', ['number', 'number[]']),
11+
... ).add_or(
12+
... Comparison.less('timestamp', datetime.fromtimestamp(1757422128))
13+
... ))
14+
>>> print(f)
15+
((('source'=='test source');('metricType'=in=('number', 'number[]'))),('timestamp'<'2025-09-09T14:48:48'))
16+
"""
117
from __future__ import annotations
218
from abc import ABC
319
from datetime import datetime
420
from typing import Any, Iterable, List
521

622

723
FieldName = str # TODO: validate field names?
8-
"""https://obelisk.pages.ilabt.imec.be/obelisk-core/query.html#available-data-point-fields"""
24+
"""https://obelisk.pages.ilabt.imec.be/obelisk-core/query.html#available-data-point-fields
25+
Field names are not validated at this time, due to the inherent complexity.
26+
"""
927

1028

1129
class Constraint(ABC):

0 commit comments

Comments
 (0)