Skip to content

codingame_tools.client.common.protocol.achievement

achievement

JSON-serializable dataclasses for the Achievement service's findByCodingamerId Codingame API method.

CgAchievementLevel module-attribute

CgAchievementLevel = str

The tier of an achievement, e.g. "BRONZE", "SILVER", "GOLD", "PLATINUM".

CgAchievement dataclass

CgAchievement(id, title, description, category_id, group_id, level, points, weight, progress, progress_max, puzzle_id, image_binary_id, _completion_time=Alias('completionTime'), extra_data=dict(), unit=None, unlock_text=None)

Bases: JSONWizardX

A single achievement unlocked by a codingamer, as returned (in a bare JSON array) by findByCodingamerId. Only unlocked achievements appear to be returned--completion_time was present on all 273 achievements observed for a long-active account.

id instance-attribute

id

Opaque (but human-readable) identifier for the achievement, e.g. "PZ_EXPERT_3".

title instance-attribute

title

Display title of the achievement, e.g. "Damn I'm good".

description instance-attribute

description

Freeform description of what the achievement requires.

category_id instance-attribute

category_id

Broad category the achievement belongs to, e.g. "puzzle", "coder", "contest", "social".

group_id instance-attribute

group_id

Narrower grouping within the category, e.g. "puzzle-level", "coder-python3".

level instance-attribute

level

The achievement's tier; see CgAchievementLevel.

points instance-attribute

points

Points awarded for unlocking this achievement.

weight instance-attribute

weight

Rarity/prestige weight of the achievement; higher values observed for rarer-seeming achievements. Precise semantics/scale unconfirmed.

progress instance-attribute

progress

The codingamer's progress towards progress_max. Can exceed progress_max (observed 4 progress against a max of 3 for one achievement)--reason unclear.

progress_max instance-attribute

progress_max

The progress value required to unlock the achievement.

puzzle_id instance-attribute

puzzle_id

ID of a specific puzzle this achievement is tied to. Always observed as 0 so far (i.e., not tied to a specific puzzle) for every achievement seen.

image_binary_id instance-attribute

image_binary_id

The binary image ID of the achievement's badge/icon image.

unit class-attribute instance-attribute

unit = None

Display unit for progress/progress_max, e.g. "very hard puzzles". Not always present--observed absent for most achievements.

unlock_text class-attribute instance-attribute

unlock_text = None

Short display text describing how to unlock the achievement, e.g. "reach 100%". Not always present--observed absent for most achievements.

completion_time property writable

completion_time

See the field docstring for _completion_time. Always UTC.