gokermu
(Mucahit Bilal GOKER)
22 March 2022 15:18
1
Hey guys,
How can I access stream activity using SpecklePy? I couldn’t see any method other than GraphQL and I know nothing about it.
1 Like
izzylys
(izzy)
22 March 2022 16:20
2
heya!
stream activity actually isn’t one of the built it actions for the specklepy client as it was added later, however it totally should be! i’ve made an issue for this and will squeeze it in this sprint. thanks for bringing this up
2 Likes
gokermu
(Mucahit Bilal GOKER)
22 March 2022 16:54
3
Great to hear that @izzylys . Waiting for it
1 Like
izzylys
(izzy)
24 March 2022 10:44
4
heya, i’ve just pushed out 2.6.3 which includes client.stream.activity()
and client.user.activity()
!
let me know if you try it out and how you get on
def activity(
self,
stream_id: str,
action_type: str = None,
limit: int = 20,
before: datetime = None,
after: datetime = None,
cursor: datetime = None,
):
"""
Get the activity from a given stream in an Activity collection. Step into the activity `items` for the list of activity.
Note: all timestamps arguments should be `datetime` of any tz as they will be converted to UTC ISO format strings
stream_id {str} -- the id of the stream to get activity from
action_type {str} -- filter results to a single action type (eg: `commit_create` or `commit_receive`)
limit {int} -- max number of Activity items to return
before {datetime} -- latest cutoff for activity (ie: return all activity _before_ this time)
after {datetime} -- oldest cutoff for activity (ie: return all activity _after_ this time)
cursor {datetime} -- timestamp cursor for pagination
"""
def activity(
self,
user_id: str = None,
limit: int = 20,
action_type: str = None,
before: datetime = None,
after: datetime = None,
cursor: datetime = None,
):
"""
Get the activity from a given stream in an Activity collection. Step into the activity `items` for the list of activity.
If no id argument is provided, will return the current authenticated user's activity (as extracted from the authorization header).
Note: all timestamps arguments should be `datetime` of any tz as they will be converted to UTC ISO format strings
user_id {str} -- the id of the user to get the activity from
action_type {str} -- filter results to a single action type (eg: `commit_create` or `commit_receive`)
limit {int} -- max number of Activity items to return
before {datetime} -- latest cutoff for activity (ie: return all activity _before_ this time)
after {datetime} -- oldest cutoff for activity (ie: return all activity _after_ this time)
This file has been truncated. show original
2 Likes