stats#

Officer-facing server stats: GET /api/stats.

Aggregated from member_activity_hour (chat/voice minutes and the XP they earned), XPGrant (event/group XP), the codebase’s shared attendance rule (sidequest_api.lib.attendance.attended_condition), and the same counted-group rule used for group XP (peak_size >= 2 and grouped_minutes/member minutes >= COUNTED_GROUP_MINUTES). Times, days, and weekday/hour buckets are America/Chicago.

class sidequest_common.schemas.stats.StatsRange[source]#

Bases: enum.StrEnum

The window GET /api/stats reports over.

SEVEN_DAYS = '7d'#
THIRTY_DAYS = '30d'#
NINETY_DAYS = '90d'#
ALL = 'all'#
class sidequest_common.schemas.stats.StatsPerson[source]#

Bases: pydantic.BaseModel

Someone on a stats list. member_id is set when they have a site account (links to their profile).

discord_id: str#
display_name: str#
avatar_url: str | None = None#
member_id: int | None = None#
class sidequest_common.schemas.stats.StatsLeader[source]#

Bases: pydantic.BaseModel

One line on a top-10 leaderboard; what value counts depends on which list it’s on.

person: StatsPerson#
value: int#
class sidequest_common.schemas.stats.StatsTotals[source]#

Bases: pydantic.BaseModel

Guild-wide activity totals over a window.

active_members: int#
messages: int#
voice_minutes: int#
events_attended: int#
groups_joined: int#
xp_gained: int#
class sidequest_common.schemas.stats.StatsTrendPoint[source]#

Bases: pydantic.BaseModel

One point on the activity trend chart: a day or a Monday-start week, per GuildStats.trend_bucket.

start: datetime.date#
messages: int#
voice_minutes: int#
active_members: int#
class sidequest_common.schemas.stats.StatsHourCell[source]#

Bases: pydantic.BaseModel

Activity in one weekday/hour slot, America/Chicago. weekday 0 is Monday.

weekday: int#
hour: int#
messages: int#
voice_minutes: int#
class sidequest_common.schemas.stats.StatsQuietMember[source]#

Bases: pydantic.BaseModel

A roster member still in the guild with no activity in the last 30 days.

person: StatsPerson#
last_active_at: datetime.datetime | None#
level: int#
class sidequest_common.schemas.stats.GuildStats[source]#

Bases: pydantic.BaseModel

GET /api/stats?range= (officer): totals, trend, heatmap, leaderboards, and quiet members.

range: StatsRange#
since: datetime.datetime | None#
tracking_since: datetime.datetime | None#
totals: StatsTotals#
previous: StatsTotals | None#
trend_bucket: Literal['day', 'week']#
trend: list[StatsTrendPoint]#
heatmap: list[StatsHourCell]#
top_chatters: list[StatsLeader]#
top_voice: list[StatsLeader]#
top_events: list[StatsLeader]#
top_groups: list[StatsLeader]#
top_xp: list[StatsLeader]#
gone_quiet: list[StatsQuietMember]#