Conversation
Line-ups are created in the Spond mobile app and the web client does not render them, but the data is served by the same consumer API and needs no special headers or client identification. get_lineups(uid) returns one dict per line-up, since an event may hold several. Only x and y are guaranteed on a player entry: a formation slot with nobody assigned to it omits membershipId and carries an empty or absent playerName. Where a player is assigned, membershipId joins to get_groups(). formationId is absent when players were placed freely rather than from a template. get_formations() returns the formation catalogue used to resolve that formationId to a name such as 4-4-2. It is static and shared across all groups, so it is cached on self.formations like the other lookups. examples/lineups.py prints a text pitch diagram per line-up, using the normalised coordinates to place each player rather than just listing names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
get_lineups(uid)andget_formations(), covering Spond's match line-ups — the arrangement of players for a fixture, set in the mobile app.get_lineups(uid)returns one dict per line-up, as an event may hold more than one. Every player entry carries normalised pitch coordinatesxandyin the range 0.0–1.0, withymeasured from the opponent's goal to the team's own, so the arrangement can be reconstructed rather than just listed. Where a player is assigned to the slot, the entry also carries amembershipId(joining toget_groups()) and aplayerName; a formation slot with nobody assigned omitsmembershipIdand has an empty or absentplayerName.formationIdis absent when players were positioned freely rather than from a template.get_formations()returns the formation catalogue (52 entries, team sizes 5–11) used to resolveformationIdto a name such as4-4-2. It is static and shared across all groups, so it is cached onself.formationsin line with the other lookups.Line-ups carry
visibility: "HOSTS_AND_ADMINS_ONLY", indicating they are readable only by an event's hosts and admins.Both are read-only GETs against the existing
core/v1base URL and need only the usual Bearer token.examples/lineups.pyprints a text pitch diagram per line-up.Notes
positions[].namein the formation catalogue is a localisation key such aslineup_football_goalkeeper, not a display string. Documented in the docstring.r.ok, followingget_profile,get_groupsandget_event_attendance_xlsx. The file is split on this —get_eventsandget_postsdo check. Happy to add the check if you'd prefer.