-
-
Notifications
You must be signed in to change notification settings - Fork 63
Implement api/timeline #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Implement api/timeline #80
Conversation
| class TimelineEvents(TypedDict): | ||
| entries: list[dict[str, Any]] | ||
| users: dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good day, the idea is not to have any Any in the response type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?
class TimelineEvent(TypedDict):
type: str
data: dict[str, str | bool]
date: int
class TimelineUser(TypedDict):
id: str
name: str
title: str
patron: NotRequired[bool]
lass TimelineEvents(TypedDict):
entries: list[TimelineEvent]
users: dict[str, TimelineUser]
Defining all the different event-data dicts seems quite unproductive
This is not tested, just trying to get this PR implemented faster...
| :param int since: timestamp to show events since, default 1356998400070 | ||
| :param int nb: max number of events to fetch, default 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :param int since: timestamp to show events since, default 1356998400070 | |
| :param int nb: max number of events to fetch, default 15 | |
| :param since: only show events after this timestamp, default 1356998400070 (the earliest allowed by Lichess) | |
| :param nb: max number of events to fetch, default 15 |
We generally leave out the types here since they are already given via the type hints.
Implements
/api/timelineendpoint documented here.Checklist when adding a new endpoint
README.mdclient.users.get_user(), Correct:client.users.get()berserk/types/, exampleCHANGELOG.mdin theTo be releasedsection (to be created if necessary)