football-docs 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/data/docs.db +0 -0
- package/dist/crawl.d.ts +7 -0
- package/dist/crawl.js +109 -7
- package/dist/discover.d.ts +8 -0
- package/dist/discover.js +12 -1
- package/dist/http.d.ts +8 -1
- package/dist/http.js +23 -1
- package/dist/ingest.js +3 -1
- package/dist/provider-truth.d.ts +7 -0
- package/dist/provider-truth.js +15 -1
- package/dist/tools.d.ts +7 -0
- package/dist/tools.js +14 -1
- package/docs/databallpy/data-model.md +5 -2
- package/docs/databallpy/overview.md +5 -3
- package/docs/fast-forward/api.md +18 -18
- package/docs/fast-forward/benchmarks.md +2 -2
- package/docs/fast-forward/concepts-coordinate-systems.md +2 -2
- package/docs/fast-forward/concepts-dataset.md +2 -2
- package/docs/fast-forward/concepts-distributed-compute.md +2 -2
- package/docs/fast-forward/concepts-filelike.md +2 -2
- package/docs/fast-forward/concepts-layouts.md +2 -2
- package/docs/fast-forward/concepts-orientations.md +2 -2
- package/docs/fast-forward/concepts-transformations.md +2 -2
- package/docs/fast-forward/getting-started.md +2 -2
- package/docs/fast-forward/index.md +2 -2
- package/docs/fast-forward/providers-cdf.md +2 -2
- package/docs/fast-forward/providers-gradientsports.md +2 -2
- package/docs/fast-forward/providers-hawkeye.md +2 -2
- package/docs/fast-forward/providers-optavision.md +2 -2
- package/docs/fast-forward/providers-respovision.md +2 -2
- package/docs/fast-forward/providers-scisports.md +2 -2
- package/docs/fast-forward/providers-secondspectrum.md +2 -2
- package/docs/fast-forward/providers-signality.md +2 -2
- package/docs/fast-forward/providers-skillcorner.md +4 -8
- package/docs/fast-forward/providers-sportec.md +3 -3
- package/docs/fast-forward/providers-statsperform.md +2 -2
- package/docs/fast-forward/providers-tracab.md +2 -2
- package/docs/fast-forward/providers.md +2 -2
- package/docs/fast-forward/reporting-issues.md +2 -2
- package/docs/floodlight/compendium-0-compendium.md +1 -1
- package/docs/floodlight/compendium-1-data.md +5 -5
- package/docs/floodlight/compendium-2-design.md +1 -1
- package/docs/floodlight/compendium-3-time.md +6 -6
- package/docs/floodlight/compendium-4-space.md +9 -9
- package/docs/floodlight/compendium-5-identifier.md +10 -10
- package/docs/floodlight/core-code.md +13 -15
- package/docs/floodlight/core-core.md +10 -28
- package/docs/floodlight/core-definitions.md +1 -1
- package/docs/floodlight/core-events.md +31 -37
- package/docs/floodlight/core-pitch.md +12 -16
- package/docs/floodlight/core-property.md +19 -25
- package/docs/floodlight/core-teamsheet.md +13 -16
- package/docs/floodlight/core-xy.md +34 -40
- package/docs/floodlight/guides-contrib-manual.md +23 -24
- package/docs/floodlight/guides-getting-started.md +9 -9
- package/docs/floodlight/guides-tutorial-analysis.md +18 -115
- package/docs/floodlight/guides-tutorial-matchsheets.md +13 -242
- package/docs/floodlight/index.md +2 -2
- package/docs/floodlight/io-datasets.md +41 -47
- package/docs/floodlight/io-dfl.md +17 -19
- package/docs/floodlight/io-io.md +35 -83
- package/docs/floodlight/io-kinexon.md +21 -27
- package/docs/floodlight/io-opta.md +9 -9
- package/docs/floodlight/io-secondspectrum.md +13 -15
- package/docs/floodlight/io-skillcorner.md +5 -6
- package/docs/floodlight/io-sportradar.md +5 -5
- package/docs/floodlight/io-statsbomb.md +9 -11
- package/docs/floodlight/io-statsperform.md +37 -43
- package/docs/floodlight/io-tracab.md +13 -14
- package/docs/floodlight/io-utils.md +11 -13
- package/docs/floodlight/metrics-entropy.md +5 -6
- package/docs/floodlight/metrics-metrics.md +1 -1
- package/docs/floodlight/metrics-trajectory-clustering.md +5 -6
- package/docs/floodlight/metrics-zone-aggregation.md +5 -6
- package/docs/floodlight/models-geometry.md +42 -47
- package/docs/floodlight/models-kinematics.md +22 -25
- package/docs/floodlight/models-kinetics.md +21 -22
- package/docs/floodlight/models-models.md +22 -67
- package/docs/floodlight/models-space.md +19 -22
- package/docs/floodlight/transforms-filter.md +21 -26
- package/docs/floodlight/transforms-interpolation.md +13 -16
- package/docs/floodlight/transforms-permutation.md +5 -6
- package/docs/floodlight/transforms-spatial.md +9 -10
- package/docs/floodlight/transforms-temporal.md +5 -6
- package/docs/floodlight/transforms-transforms.md +19 -37
- package/docs/floodlight/utils-types.md +2 -2
- package/docs/floodlight/utils-utils.md +1 -1
- package/docs/floodlight/vis-pitches.md +9 -11
- package/docs/floodlight/vis-positions.md +9 -11
- package/docs/floodlight/vis-vis.md +5 -8
- package/docs/fmdb-pro/api-access.md +10 -1
- package/docs/fmdb-pro/data-model.md +6 -2
- package/docs/free-sources/overview.md +1 -1
- package/docs/mplsoccer/overview.md +5 -1
- package/docs/mplsoccer/visualizations.md +27 -0
- package/docs/skillcorner/api-access.md +7 -4
- package/docs/skillcorner/api-endpoints.md +3 -3
- package/docs/skillcorner/concepts.md +3 -3
- package/docs/skillcorner/coordinate-system.md +3 -3
- package/docs/skillcorner/data-model.md +17 -4
- package/docs/skillcorner/identity-surfaces.md +3 -3
- package/docs/skillcorner/physical-data.md +3 -3
- package/docs/sportmonks/api-changes.md +267 -0
- package/docs/sportmonks/authentication.md +61 -0
- package/docs/sportmonks/best-practices.md +416 -0
- package/docs/sportmonks/changelog-beta.md +156 -0
- package/docs/sportmonks/changelog.md +907 -0
- package/docs/sportmonks/code-libraries.md +28 -0
- package/docs/sportmonks/data-corrections.md +33 -0
- package/docs/sportmonks/demo-response-files.md +131 -0
- package/docs/sportmonks/differences-between-api-2-and-api-3.md +29 -0
- package/docs/sportmonks/endpoints.md +427 -0
- package/docs/sportmonks/error-codes.md +897 -0
- package/docs/sportmonks/filtering-and-complexity-exceptions.md +15 -0
- package/docs/sportmonks/filtering.md +35 -0
- package/docs/sportmonks/fixtures.md +36 -0
- package/docs/sportmonks/get-all-fixtures.md +271 -0
- package/docs/sportmonks/get-all-leagues-by-team-id.md +260 -0
- package/docs/sportmonks/get-all-leagues.md +260 -0
- package/docs/sportmonks/get-all-livescores.md +270 -0
- package/docs/sportmonks/get-all-seasons.md +261 -0
- package/docs/sportmonks/get-all-states.md +307 -0
- package/docs/sportmonks/get-all-types.md +252 -0
- package/docs/sportmonks/get-brackets-by-season-id.md +897 -0
- package/docs/sportmonks/get-current-leagues-by-team-id.md +235 -0
- package/docs/sportmonks/get-fixture-by-id.md +267 -0
- package/docs/sportmonks/get-fixtures-by-date-range-for-team.md +287 -0
- package/docs/sportmonks/get-fixtures-by-date-range.md +298 -0
- package/docs/sportmonks/get-fixtures-by-date.md +300 -0
- package/docs/sportmonks/get-fixtures-by-head-to-head.md +288 -0
- package/docs/sportmonks/get-fixtures-by-multiple-ids.md +288 -0
- package/docs/sportmonks/get-fixtures-by-search-by-name.md +270 -0
- package/docs/sportmonks/get-inplay-livescores.md +270 -0
- package/docs/sportmonks/get-latest-updated-fixtures.md +327 -0
- package/docs/sportmonks/get-latest-updated-livescores.md +335 -0
- package/docs/sportmonks/get-league-by-id.md +241 -0
- package/docs/sportmonks/get-leagues-by-country-id.md +256 -0
- package/docs/sportmonks/get-leagues-by-fixture-date.md +260 -0
- package/docs/sportmonks/get-leagues-by-live.md +241 -0
- package/docs/sportmonks/get-leagues-search-by-name.md +260 -0
- package/docs/sportmonks/get-past-fixtures-by-tv-station-id.md +293 -0
- package/docs/sportmonks/get-seasons-by-id.md +242 -0
- package/docs/sportmonks/get-seasons-by-search-by-name.md +261 -0
- package/docs/sportmonks/get-seasons-by-team-id.md +256 -0
- package/docs/sportmonks/get-state-by-id.md +241 -0
- package/docs/sportmonks/get-type-by-entity.md +221 -0
- package/docs/sportmonks/get-type-by-id.md +237 -0
- package/docs/sportmonks/get-upcoming-fixtures-by-market-id.md +293 -0
- package/docs/sportmonks/get-upcoming-fixtures-by-tv-station-id.md +294 -0
- package/docs/sportmonks/getting-started.md +357 -0
- package/docs/sportmonks/include-exceptions.md +16 -0
- package/docs/sportmonks/includes.md +107 -0
- package/docs/sportmonks/leagues.md +931 -0
- package/docs/sportmonks/livescores.md +29 -0
- package/docs/sportmonks/making-your-first-request.md +840 -0
- package/docs/sportmonks/meta-description.md +61 -0
- package/docs/sportmonks/nested-includes.md +248 -0
- package/docs/sportmonks/new-endpoints-and-data-features.md +70 -0
- package/docs/sportmonks/ordering-and-sorting.md +114 -0
- package/docs/sportmonks/other-exceptions.md +16 -0
- package/docs/sportmonks/overview.md +17 -0
- package/docs/sportmonks/rate-limit.md +1078 -0
- package/docs/sportmonks/request-options.md +29 -0
- package/docs/sportmonks/seasons.md +35 -0
- package/docs/sportmonks/selecting-and-filtering.md +169 -0
- package/docs/sportmonks/selecting-fields.md +275 -0
- package/docs/sportmonks/states.md +30 -0
- package/docs/sportmonks/statistics.md +26 -0
- package/docs/sportmonks/syntax-and-filters.md +425 -0
- package/docs/sportmonks/syntax.md +63 -0
- package/docs/sportmonks/translations-beta.md +133 -0
- package/docs/sportmonks/types.md +25 -0
- package/docs/sportmonks/what-can-you-do-with-sportmonks-data.md +175 -0
- package/docs/sportradar/data-model.md +16 -1
- package/docs/statsbomb/api-access.md +12 -7
- package/docs/statsbomb/api-endpoints.md +2 -2
- package/docs/statsbomb/identity-surfaces.md +1 -1
- package/docs/statsbomb/iq-metrics-glossary.md +1 -1
- package/docs/statsbomb/player-mapping.md +1 -1
- package/docs/statsbomb/player-match-stats.md +1 -1
- package/docs/statsbomb/player-season-stats.md +1 -1
- package/docs/statsbomb/team-match-stats.md +1 -1
- package/docs/statsbomb/team-season-stats.md +1 -1
- package/docs/transferroom/api-access.md +27 -10
- package/docs/transferroom/api-endpoints.md +56 -41
- package/docs/transferroom/data-model.md +2 -2
- package/docs/transferroom/identity-surfaces.md +2 -2
- package/docs/unravelsports/additional-citations.md +1 -1
- package/docs/unravelsports/additional-license.md +1 -1
- package/docs/unravelsports/american-football-dataset.md +18 -20
- package/docs/unravelsports/american-football-graphs.md +17 -21
- package/docs/unravelsports/api-american-football.md +1 -1
- package/docs/unravelsports/api-classifiers.md +34 -42
- package/docs/unravelsports/api-soccer.md +1 -1
- package/docs/unravelsports/api-utils.md +1 -1
- package/docs/unravelsports/generated-unravel-utils-add-dummy-label-column.md +3 -3
- package/docs/unravelsports/generated-unravel-utils-add-graph-id-column.md +3 -3
- package/docs/unravelsports/generated-unravel-utils-dummy-graph-ids.md +4 -4
- package/docs/unravelsports/generated-unravel-utils-dummy-labels.md +4 -4
- package/docs/unravelsports/getting-started-concepts.md +1 -1
- package/docs/unravelsports/getting-started-installation.md +1 -1
- package/docs/unravelsports/getting-started-quickstart.md +1 -1
- package/docs/unravelsports/index.md +1 -1
- package/docs/unravelsports/soccer-dataset.md +39 -44
- package/docs/unravelsports/soccer-graphs.md +35 -42
- package/docs/unravelsports/soccer-models.md +34 -42
- package/docs/unravelsports/tutorials-american-football.md +1 -1
- package/docs/unravelsports/tutorials-formation-detection.md +1 -1
- package/docs/unravelsports/tutorials-pressing-intensity.md +1 -1
- package/docs/unravelsports/tutorials-soccer-gnn.md +1 -1
- package/docs/unravelsports/utils-features.md +8 -9
- package/docs/unravelsports/utils-helpers.md +11 -13
- package/docs/unravelsports/utils-objects.md +4 -5
- package/docs/wyscout/api-access.md +10 -3
- package/docs/wyscout/api-endpoints.md +2 -2
- package/docs/wyscout/coordinate-system.md +2 -2
- package/docs/wyscout/data-model.md +32 -2
- package/docs/wyscout/event-types.md +2 -2
- package/package.json +27 -29
- package/providers.json +42 -12
package/README.md
CHANGED
|
@@ -108,23 +108,23 @@ Provider filters use the indexed provider keys shown by `list_providers`, but co
|
|
|
108
108
|
|
|
109
109
|
| Provider | Chunks | Categories |
|
|
110
110
|
|----------|--------|------------|
|
|
111
|
-
| fast-forward |
|
|
111
|
+
| fast-forward | 250 | overview, getting-started, data-model, coordinate-system, orientations, layouts, transformations, distributed-compute, api-reference, 12 provider format pages |
|
|
112
112
|
| StatsBomb | 235 | event-types, data-model, coordinate-system, api-access, api-endpoints, charting-lineups, xg-model, iq-metrics, player/team stats, player-mapping, identity-surfaces |
|
|
113
113
|
| unravelsports | 202 | overview, installation, quickstart, concepts, graph converters, pressing intensity, formation detection, models, utils, american-football |
|
|
114
|
-
| Wyscout |
|
|
114
|
+
| Wyscout | 163 | event-types, data-model, coordinate-system, api-access, api-endpoints, charting-analysis-metrics, glossary, identity-surfaces |
|
|
115
115
|
| kloppy | 126 | data-model, usage, provider-mapping, tracking-rendering, event-derived-metrics |
|
|
116
|
-
| floodlight |
|
|
117
|
-
| SportMonks |
|
|
116
|
+
| floodlight | 144 | core data objects, io parsers (Tracab, DFL, Kinexon, Opta, SkillCorner, StatsBomb, StatsPerform, Second Spectrum), transforms, metrics, models, visualisation, guides |
|
|
117
|
+
| SportMonks | 565 | full v3 endpoint reference (fixtures, livescores, leagues, seasons, states, types, statistics, brackets), syntax and includes, filtering, rate limits, error codes, changelog, plus curated event-types, data-model, api-access, charting-season-stories, identity-surfaces |
|
|
118
118
|
| databallpy | 63 | data-model, overview, usage |
|
|
119
|
-
| mplsoccer |
|
|
119
|
+
| mplsoccer | 65 | overview, pitch-types, visualizations |
|
|
120
120
|
| Impect | 77 | overview, data-model, event-types, coordinate-system, concepts, kpi-definitions, identity-surfaces |
|
|
121
|
-
| SkillCorner |
|
|
121
|
+
| SkillCorner | 49 | api-access, api-endpoints, data-model, physical-data, coordinate-system, concepts, identity-surfaces |
|
|
122
122
|
| Free sources | 62 | overview, fbref, understat, contextual-story-joins, xg-timelines |
|
|
123
123
|
| soccerdata | 40 | overview, data-sources, usage |
|
|
124
124
|
| TransferRoom | 43 | api-access, api-endpoints, charting-availability, data-model, identity-surfaces |
|
|
125
125
|
| Opta | 71 | event-types, qualifiers, coordinate-system, api-access, charting-game-state, charting-lineups, charting-passmaps, charting-set-pieces, charting-shot-placement, identity-surfaces |
|
|
126
126
|
| FMDB Pro | 35 | api-access, api-endpoints, data-model, identity-surfaces |
|
|
127
|
-
| Sportradar |
|
|
127
|
+
| Sportradar | 30 | api-access, api-endpoints, data-model, charting-and-stories, integration-notes |
|
|
128
128
|
| socceraction | 34 | SPADL format, VAEP, Expected Threat |
|
|
129
129
|
| BeSoccer | 14 | api-access, api-endpoints |
|
|
130
130
|
| TheSportsDB | 18 | api-access, api-endpoints, livescore, identity-surfaces |
|
|
@@ -132,7 +132,7 @@ Provider filters use the indexed provider keys shown by `list_providers`, but co
|
|
|
132
132
|
| Soccerdonna | 3 | identity-surfaces |
|
|
133
133
|
| Transfermarkt | 3 | identity-surfaces |
|
|
134
134
|
|
|
135
|
-
**
|
|
135
|
+
**2,295 searchable chunks** across 23 providers and tools.
|
|
136
136
|
|
|
137
137
|
> **Impect** documentation is built solely from the public
|
|
138
138
|
> [ImpectAPI/open-data](https://github.com/ImpectAPI/open-data) repository — a
|
|
@@ -166,8 +166,10 @@ pnpm openapi:truth # rebuild every spec-derived truth file
|
|
|
166
166
|
|
|
167
167
|
The specs those derive from are snapshots of **publicly published, unauthenticated**
|
|
168
168
|
vendor documentation. Source URLs, fetch dates and refresh instructions are in
|
|
169
|
-
[`specs/README.md`](specs/README.md). Wyscout's
|
|
170
|
-
truth file, because its docs
|
|
169
|
+
[`specs/README.md`](specs/README.md). Wyscout's v3 and v4 specifications merge into
|
|
170
|
+
one truth file, because its docs span both. The v2 legacy specification is no
|
|
171
|
+
longer mirrored: the docs describe v3 and v4, and no documented fact derives from
|
|
172
|
+
the legacy surface.
|
|
171
173
|
|
|
172
174
|
Each package gets its own pinned venv — co-installing them makes pip silently
|
|
173
175
|
downgrade conflicting versions, which would produce truth that disagrees with the
|
package/data/docs.db
CHANGED
|
Binary file
|
package/dist/crawl.d.ts
CHANGED
|
@@ -25,6 +25,13 @@ interface CrawledDoc {
|
|
|
25
25
|
* to isolate the main content, then Turndown to convert to markdown.
|
|
26
26
|
*/
|
|
27
27
|
export declare function htmlToMarkdown(html: string, url: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Drop the categories a provider's registry entry excludes. Kept separate from
|
|
30
|
+
* the crawl loop so the rule is testable without going near the network.
|
|
31
|
+
*/
|
|
32
|
+
export declare function applyCategoryExclusions<T extends {
|
|
33
|
+
category: string;
|
|
34
|
+
}>(docs: T[], excluded: string[] | undefined): T[];
|
|
28
35
|
/**
|
|
29
36
|
* Crawl an llms.txt or llms-full.txt file.
|
|
30
37
|
* Already structured for LLM consumption — chunk by top-level heading.
|
package/dist/crawl.js
CHANGED
|
@@ -62,12 +62,31 @@ turndown.addRule("sphinxPreSpan", {
|
|
|
62
62
|
// becomes `## Orientations[¶](https://.../#orientations "Permanent link")`, and
|
|
63
63
|
// since a chunk is titled by its heading that URL is the first thing an agent
|
|
64
64
|
// reads in a search result. It carries no information the frontmatter lacks.
|
|
65
|
+
// Sphinx and mkdocs append a permalink anchor to every heading and every API
|
|
66
|
+
// definition. Its visible text is junk (a pilcrow, or nothing at all), so it
|
|
67
|
+
// has to go. But on an API definition the href fragment is the only place the
|
|
68
|
+
// fully-qualified name appears: the signature itself renders as `frame`(t),
|
|
69
|
+
// and dropping the anchor took floodlight.core.xy.XY.frame out of the corpus
|
|
70
|
+
// with it - 93 identifiers on floodlight alone. A heading's fragment is a
|
|
71
|
+
// slug (#decoupling-data-and-pitches) and carries nothing, so keep the
|
|
72
|
+
// fragment only when it looks like a dotted identifier.
|
|
73
|
+
const DOTTED_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)+$/;
|
|
65
74
|
turndown.addRule("headerlink", {
|
|
66
75
|
filter: (node) => node.nodeName === "A" &&
|
|
67
76
|
(node.getAttribute?.("class") ?? "")
|
|
68
77
|
.split(/\s+/)
|
|
69
78
|
.includes("headerlink"),
|
|
70
|
-
replacement: () =>
|
|
79
|
+
replacement: (_content, node) => {
|
|
80
|
+
const href = node.getAttribute?.("href") ?? "";
|
|
81
|
+
const fragment = href.slice(href.indexOf("#") + 1);
|
|
82
|
+
if (!href.includes("#") || !DOTTED_IDENTIFIER.test(fragment))
|
|
83
|
+
return "";
|
|
84
|
+
// A code span, not bare text: the name sits immediately after the
|
|
85
|
+
// signature, and backticks keep it one searchable token. The enum-member
|
|
86
|
+
// check only matches SCREAMING_SNAKE inside backticks, so a dotted
|
|
87
|
+
// lowercase path adds search coverage without inventing a truth-file claim.
|
|
88
|
+
return ` \`${fragment}\``;
|
|
89
|
+
},
|
|
71
90
|
});
|
|
72
91
|
// Turndown has no table rule, so a <table> falls through to block handling and
|
|
73
92
|
// every cell lands on its own line. That is worse than losing the table: a
|
|
@@ -142,6 +161,39 @@ turndown.addRule("gfmTable", {
|
|
|
142
161
|
return `\n\n${[line(header), `|${" --- |".repeat(width)}`, ...rest.map(line)].join("\n")}\n\n`;
|
|
143
162
|
},
|
|
144
163
|
});
|
|
164
|
+
// Definition lists lose their structure the same way tables did. Sphinx writes
|
|
165
|
+
// prose glossaries and "Parameters:"/"Returns:" field lists as <dl>, and with no
|
|
166
|
+
// rule the terms and their descriptions all land as unattached paragraphs -
|
|
167
|
+
// "Unit of measurement" then "What's x and y measured in?", with nothing to say
|
|
168
|
+
// which is the term. Bold marks the term, so the pair survives as a pair.
|
|
169
|
+
//
|
|
170
|
+
// Scoped deliberately: Sphinx also renders API signatures as <dl class="py
|
|
171
|
+
// method">, where the <dt> is the signature itself. Bolding those would fight
|
|
172
|
+
// the code formatting they already carry, so only plain and field-list <dl>s
|
|
173
|
+
// are rewritten.
|
|
174
|
+
const isPlainDefinitionList = (node) => {
|
|
175
|
+
const parent = node.parentNode;
|
|
176
|
+
if (parent?.nodeName !== "DL")
|
|
177
|
+
return false;
|
|
178
|
+
const classes = (parent.getAttribute?.("class") ?? "").split(/\s+/);
|
|
179
|
+
if (classes.includes("py"))
|
|
180
|
+
return false;
|
|
181
|
+
return classes.includes("simple") || classes.includes("field-list");
|
|
182
|
+
};
|
|
183
|
+
turndown.addRule("definitionTerm", {
|
|
184
|
+
filter: (node) => node.nodeName === "DT" && isPlainDefinitionList(node),
|
|
185
|
+
replacement: (content) => {
|
|
186
|
+
const term = content.replace(/\s+/g, " ").trim();
|
|
187
|
+
return term ? `\n\n**${term}**\n\n` : "";
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
turndown.addRule("definitionDescription", {
|
|
191
|
+
filter: (node) => node.nodeName === "DD" && isPlainDefinitionList(node),
|
|
192
|
+
replacement: (content) => {
|
|
193
|
+
const body = content.trim();
|
|
194
|
+
return body ? `${body}\n\n` : "";
|
|
195
|
+
},
|
|
196
|
+
});
|
|
145
197
|
// Turndown escapes every underscore in plain text nodes by default (guarding
|
|
146
198
|
// against accidental markdown emphasis), including identifiers that carry no
|
|
147
199
|
// code markup at all — e.g. Sphinx renders parameter/return names in
|
|
@@ -179,13 +231,16 @@ export function htmlToMarkdown(html, url) {
|
|
|
179
231
|
? html
|
|
180
232
|
: html.replace(/(<head[^>]*>)/i, `$1<base href="${url}">`);
|
|
181
233
|
const { document } = parseHTML(htmlWithBase);
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
234
|
+
// Readability strips every class it is not told to keep, so any Turndown rule
|
|
235
|
+
// that keys off one has to name it here:
|
|
236
|
+
// pre Sphinx's no-wrap marker for inline literals (sphinxPreSpan)
|
|
237
|
+
// headerlink Sphinx's and mkdocs' permalink anchor (headerlink)
|
|
238
|
+
// simple a plain <dl> glossary (definitionTerm/definitionDescription)
|
|
239
|
+
// field-list a Sphinx "Parameters:"/"Returns:" block, same rules
|
|
240
|
+
// py a Python API signature <dl>, which those rules must skip
|
|
186
241
|
const reader = new Readability(document, {
|
|
187
242
|
charThreshold: 100,
|
|
188
|
-
classesToPreserve: ["pre", "headerlink"],
|
|
243
|
+
classesToPreserve: ["pre", "headerlink", "simple", "field-list", "py"],
|
|
189
244
|
});
|
|
190
245
|
const article = reader.parse();
|
|
191
246
|
if (!article?.content)
|
|
@@ -193,6 +248,24 @@ export function htmlToMarkdown(html, url) {
|
|
|
193
248
|
return turndown.turndown(article.content);
|
|
194
249
|
}
|
|
195
250
|
// ── Crawl strategies ─────────────────────────────────────────────────
|
|
251
|
+
/**
|
|
252
|
+
* A large llms-full.txt concatenates whole documentation pages under `#`
|
|
253
|
+
* headings. Splitting those on `##` as well shreds each page into fragments
|
|
254
|
+
* that lose the context they need to answer anything — a lone "Wrong: no token"
|
|
255
|
+
* error case, say. Once a file carries at least this many `#` headings, they are
|
|
256
|
+
* document boundaries on their own and `##` is left alone.
|
|
257
|
+
*/
|
|
258
|
+
const LLMS_H1_ONLY_THRESHOLD = 10;
|
|
259
|
+
/**
|
|
260
|
+
* Drop the categories a provider's registry entry excludes. Kept separate from
|
|
261
|
+
* the crawl loop so the rule is testable without going near the network.
|
|
262
|
+
*/
|
|
263
|
+
export function applyCategoryExclusions(docs, excluded) {
|
|
264
|
+
if (!excluded?.length)
|
|
265
|
+
return docs;
|
|
266
|
+
const skip = new Set(excluded);
|
|
267
|
+
return docs.filter((doc) => !skip.has(doc.category));
|
|
268
|
+
}
|
|
196
269
|
/**
|
|
197
270
|
* Crawl an llms.txt or llms-full.txt file.
|
|
198
271
|
* Already structured for LLM consumption — chunk by top-level heading.
|
|
@@ -200,10 +273,33 @@ export function htmlToMarkdown(html, url) {
|
|
|
200
273
|
export function crawlLlmsTxt(content, sourceUrl) {
|
|
201
274
|
const sections = [];
|
|
202
275
|
const lines = content.split("\n");
|
|
276
|
+
// Headings inside a fenced code block are sample code or comments, not
|
|
277
|
+
// structure: splitting on one cuts the fence in half and leaves both pieces
|
|
278
|
+
// malformed. Track the fences so those lines are skipped.
|
|
279
|
+
const isFence = (line) => /^ {0,3}(`{3,}|~{3,})/.test(line);
|
|
280
|
+
const headingAt = (line) => line.match(/^(#{1,2})\s+(.+)/);
|
|
281
|
+
let fenced = false;
|
|
282
|
+
let h1Count = 0;
|
|
283
|
+
for (const line of lines) {
|
|
284
|
+
if (isFence(line)) {
|
|
285
|
+
fenced = !fenced;
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (!fenced && headingAt(line)?.[1] === "#")
|
|
289
|
+
h1Count += 1;
|
|
290
|
+
}
|
|
291
|
+
const maxHeadingLevel = h1Count >= LLMS_H1_ONLY_THRESHOLD ? 1 : 2;
|
|
203
292
|
let currentTitle = "overview";
|
|
204
293
|
let currentLines = [];
|
|
294
|
+
fenced = false;
|
|
205
295
|
for (const line of lines) {
|
|
206
|
-
|
|
296
|
+
if (isFence(line))
|
|
297
|
+
fenced = !fenced;
|
|
298
|
+
const headingMatch = fenced ? null : headingAt(line);
|
|
299
|
+
if (headingMatch && headingMatch[1].length > maxHeadingLevel) {
|
|
300
|
+
currentLines.push(line);
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
207
303
|
if (headingMatch && currentLines.length > 0) {
|
|
208
304
|
const body = currentLines.join("\n").trim();
|
|
209
305
|
if (body.length > 50) {
|
|
@@ -566,6 +662,12 @@ async function main() {
|
|
|
566
662
|
console.log(` → no content extracted`);
|
|
567
663
|
continue;
|
|
568
664
|
}
|
|
665
|
+
const kept = applyCategoryExclusions(docs, config.exclude_categories);
|
|
666
|
+
const skipped = docs.length - kept.length;
|
|
667
|
+
if (skipped > 0) {
|
|
668
|
+
console.log(` skipped ${skipped} excluded categor${skipped === 1 ? "y" : "ies"}`);
|
|
669
|
+
}
|
|
670
|
+
docs = kept;
|
|
569
671
|
for (const doc of docs) {
|
|
570
672
|
writeCrawledDoc(name, doc, config.version);
|
|
571
673
|
console.log(` wrote ${name}/${doc.category}.md (${doc.content.length} chars) [${doc.source_type}]`);
|
package/dist/discover.d.ts
CHANGED
|
@@ -34,6 +34,14 @@ export interface ProbeResult {
|
|
|
34
34
|
isReadTheDocs: boolean;
|
|
35
35
|
isReachable: boolean;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* A site whose router answers every unknown path with its own shell returns the
|
|
39
|
+
* documentation page's HTML for /llms-full.txt, with a 200 and no redirect.
|
|
40
|
+
* TheSportsDB and FMDB Pro both do this. Crawling that as llms.txt writes a doc
|
|
41
|
+
* that is markup rather than documentation, so reject anything that opens like
|
|
42
|
+
* an HTML document.
|
|
43
|
+
*/
|
|
44
|
+
export declare function looksLikeHtml(content: string): boolean;
|
|
37
45
|
/**
|
|
38
46
|
* Choose the best source to crawl from probe results.
|
|
39
47
|
*
|
package/dist/discover.js
CHANGED
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
* const result = await discoverBestSource(provider);
|
|
10
10
|
*/
|
|
11
11
|
import { fetchText, urlExists } from "./http.js";
|
|
12
|
+
/**
|
|
13
|
+
* A site whose router answers every unknown path with its own shell returns the
|
|
14
|
+
* documentation page's HTML for /llms-full.txt, with a 200 and no redirect.
|
|
15
|
+
* TheSportsDB and FMDB Pro both do this. Crawling that as llms.txt writes a doc
|
|
16
|
+
* that is markup rather than documentation, so reject anything that opens like
|
|
17
|
+
* an HTML document.
|
|
18
|
+
*/
|
|
19
|
+
export function looksLikeHtml(content) {
|
|
20
|
+
const head = content.trimStart().slice(0, 512).toLowerCase();
|
|
21
|
+
return head.startsWith("<!doctype") || head.startsWith("<html") || head.includes("<head");
|
|
22
|
+
}
|
|
12
23
|
/**
|
|
13
24
|
* Probe a base URL for llms.txt variants.
|
|
14
25
|
* Returns the URL and content of the best llms.txt found, or null.
|
|
@@ -18,7 +29,7 @@ async function probeLlmsTxt(baseUrl) {
|
|
|
18
29
|
for (const filename of ["llms-full.txt", "llms.txt"]) {
|
|
19
30
|
const url = `${root}/${filename}`;
|
|
20
31
|
const content = await fetchText(url);
|
|
21
|
-
if (content && content.length > 100) {
|
|
32
|
+
if (content && content.length > 100 && !looksLikeHtml(content)) {
|
|
22
33
|
return { url, content };
|
|
23
34
|
}
|
|
24
35
|
}
|
package/dist/http.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/** Shared HTTP utilities for crawling and discovery. */
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Check if a URL returns a successful response.
|
|
4
|
+
*
|
|
5
|
+
* HEAD first, because it is cheap, then a one-byte ranged GET when HEAD fails.
|
|
6
|
+
* Some hosts serve a document happily on GET and answer HEAD with a 404 -
|
|
7
|
+
* api.fmdb.pro does exactly that for its OpenAPI document - and reporting those
|
|
8
|
+
* as missing sends a maintainer chasing a source that was never gone.
|
|
9
|
+
*/
|
|
3
10
|
export declare function urlExists(url: string): Promise<{
|
|
4
11
|
ok: boolean;
|
|
5
12
|
contentType?: string;
|
package/dist/http.js
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
/** Shared HTTP utilities for crawling and discovery. */
|
|
2
2
|
const MAX_RESPONSE_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Check if a URL returns a successful response.
|
|
5
|
+
*
|
|
6
|
+
* HEAD first, because it is cheap, then a one-byte ranged GET when HEAD fails.
|
|
7
|
+
* Some hosts serve a document happily on GET and answer HEAD with a 404 -
|
|
8
|
+
* api.fmdb.pro does exactly that for its OpenAPI document - and reporting those
|
|
9
|
+
* as missing sends a maintainer chasing a source that was never gone.
|
|
10
|
+
*/
|
|
4
11
|
export async function urlExists(url) {
|
|
5
12
|
try {
|
|
6
13
|
const response = await fetch(url, {
|
|
7
14
|
method: "HEAD",
|
|
8
15
|
signal: AbortSignal.timeout(5000),
|
|
9
16
|
});
|
|
17
|
+
if (response.ok) {
|
|
18
|
+
return {
|
|
19
|
+
ok: true,
|
|
20
|
+
contentType: response.headers.get("content-type") ?? undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// Fall through to the GET probe below.
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(url, {
|
|
29
|
+
headers: { Range: "bytes=0-0" },
|
|
30
|
+
signal: AbortSignal.timeout(10000),
|
|
31
|
+
});
|
|
10
32
|
return {
|
|
11
33
|
ok: response.ok,
|
|
12
34
|
contentType: response.headers.get("content-type") ?? undefined,
|
package/dist/ingest.js
CHANGED
|
@@ -51,7 +51,9 @@ export function parseFrontmatter(text) {
|
|
|
51
51
|
const [, key, value] = match;
|
|
52
52
|
const cleaned = value.replace(/^["']|["']$/g, "").trim();
|
|
53
53
|
if (key in fm) {
|
|
54
|
-
|
|
54
|
+
// `crawled_at: null` is YAML for absent, not for the four-letter string.
|
|
55
|
+
// Storing it verbatim puts "null" in front of readers in search results.
|
|
56
|
+
fm[key] = cleaned && cleaned !== "null" ? cleaned : null;
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
}
|
package/dist/provider-truth.d.ts
CHANGED
|
@@ -98,6 +98,13 @@ export declare function loadProviderDocs(provider: string): DocFile[];
|
|
|
98
98
|
export declare function extractImportedSymbols(text: string, pkg: string): string[];
|
|
99
99
|
/** SCREAMING_SNAKE_CASE tokens inside backtick code spans. */
|
|
100
100
|
export declare function extractEnumTokens(text: string): string[];
|
|
101
|
+
/**
|
|
102
|
+
* A provider can have both a package truth and a spec truth - SkillCorner ships
|
|
103
|
+
* a pip client and publishes an OpenAPI document. A doc citing a value the spec
|
|
104
|
+
* enumerates (`U23`, say) is grounded, even though the pip package never names
|
|
105
|
+
* it, so the spec's enum members count as known tokens here too.
|
|
106
|
+
*/
|
|
107
|
+
export declare function specEnumTokens(provider: string): string[];
|
|
101
108
|
export declare function validateProviderDocs(docs: DocFile[], truth: PythonPackageTruth): string[];
|
|
102
109
|
/**
|
|
103
110
|
* `param="value"` pairs a doc writes, for parameters with a Literal annotation.
|
package/dist/provider-truth.js
CHANGED
|
@@ -60,7 +60,9 @@ const TOKEN_ALLOWLIST = {
|
|
|
60
60
|
skillcorner: ["GET", "POST"],
|
|
61
61
|
// Match-official position codes emitted when include_officials=True. They come
|
|
62
62
|
// from the Rust core rather than a Python enum, so introspection cannot see them.
|
|
63
|
-
|
|
63
|
+
// FOURTH is the fourth official: the Rust core emits "4TH" and 0.3.0 relabels it
|
|
64
|
+
// via _OFFICIAL_POSITION_RELABEL in fastforward._dataset.
|
|
65
|
+
"fast-forward": ["REF", "AREF", "VAR", "AVAR", "FOURTH"],
|
|
64
66
|
// A torchmetrics metric the training loop tracks, not an unravel symbol.
|
|
65
67
|
unravelsports: ["AUROC"],
|
|
66
68
|
};
|
|
@@ -224,6 +226,17 @@ export function extractEnumTokens(text) {
|
|
|
224
226
|
out.add(match[1]);
|
|
225
227
|
return [...out];
|
|
226
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* A provider can have both a package truth and a spec truth - SkillCorner ships
|
|
231
|
+
* a pip client and publishes an OpenAPI document. A doc citing a value the spec
|
|
232
|
+
* enumerates (`U23`, say) is grounded, even though the pip package never names
|
|
233
|
+
* it, so the spec's enum members count as known tokens here too.
|
|
234
|
+
*/
|
|
235
|
+
export function specEnumTokens(provider) {
|
|
236
|
+
if (!listOpenApiProviders().includes(provider))
|
|
237
|
+
return [];
|
|
238
|
+
return Object.values(loadOpenApiTruth(provider).enums).flat();
|
|
239
|
+
}
|
|
227
240
|
export function validateProviderDocs(docs, truth) {
|
|
228
241
|
const violations = [];
|
|
229
242
|
const pkg = truth.source.package;
|
|
@@ -238,6 +251,7 @@ export function validateProviderDocs(docs, truth) {
|
|
|
238
251
|
const knownTokens = new Set([
|
|
239
252
|
...Object.values(truth.enums).flat(),
|
|
240
253
|
...truth.symbols,
|
|
254
|
+
...specEnumTokens(truth.provider),
|
|
241
255
|
...(TOKEN_ALLOWLIST[truth.provider] ?? []),
|
|
242
256
|
]);
|
|
243
257
|
for (const { file, text } of docs) {
|
package/dist/tools.d.ts
CHANGED
|
@@ -47,6 +47,13 @@ export type ResolveEntityArgs = {
|
|
|
47
47
|
* like "Opta qualifier 76" to match docs that contain those tokens separately.
|
|
48
48
|
*/
|
|
49
49
|
export declare function sanitiseFtsQuery(query: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Upstream versions are whatever the provider calls its own release: a bare
|
|
52
|
+
* number ("0.3.0"), a version already carrying its prefix ("v3"), or a phrase
|
|
53
|
+
* ("Soccer v4 / Soccer Extended v4"). Only prefix the bare numbers, so a reader
|
|
54
|
+
* never sees "vv3" or "vSoccer v4".
|
|
55
|
+
*/
|
|
56
|
+
export declare function versionLabel(version: string | null): string;
|
|
50
57
|
export declare function resolveProviderId(db: Database.Database, args: ResolveProviderIdArgs): ToolResponse;
|
|
51
58
|
export declare function getProviderDocs(db: Database.Database, args: GetProviderDocsArgs): ToolResponse;
|
|
52
59
|
export declare function searchDocs(db: Database.Database, args: SearchDocsArgs): ToolResponse;
|
package/dist/tools.js
CHANGED
|
@@ -208,12 +208,25 @@ function compareRowsForProvider(db, matchQuery, provider, limit) {
|
|
|
208
208
|
LIMIT ?`)
|
|
209
209
|
.all(matchQuery, normaliseProvider(provider), limit);
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Upstream versions are whatever the provider calls its own release: a bare
|
|
213
|
+
* number ("0.3.0"), a version already carrying its prefix ("v3"), or a phrase
|
|
214
|
+
* ("Soccer v4 / Soccer Extended v4"). Only prefix the bare numbers, so a reader
|
|
215
|
+
* never sees "vv3" or "vSoccer v4".
|
|
216
|
+
*/
|
|
217
|
+
export function versionLabel(version) {
|
|
218
|
+
const trimmed = version?.trim();
|
|
219
|
+
if (!trimmed)
|
|
220
|
+
return "";
|
|
221
|
+
return /^\d/.test(trimmed) ? `v${trimmed}` : trimmed;
|
|
222
|
+
}
|
|
211
223
|
function sourceLabel(row) {
|
|
212
224
|
const crawledAt = row.crawled_at ? ` | crawled ${row.crawled_at}` : "";
|
|
213
225
|
if (row.source_type === "curated") {
|
|
214
226
|
return `**Source:** curated by football-docs contributors${crawledAt}`;
|
|
215
227
|
}
|
|
216
|
-
|
|
228
|
+
const version = versionLabel(row.upstream_version);
|
|
229
|
+
return `**Source:** ${row.source_type}${row.source_url ? ` (${row.source_url})` : ""}${version ? ` | ${version}` : ""}${crawledAt}`;
|
|
217
230
|
}
|
|
218
231
|
function providerMetadata(provider) {
|
|
219
232
|
return PROVIDER_REGISTRY.providers[provider];
|
|
@@ -131,9 +131,12 @@ Extends `IndividualOnBallEvent`. Adds: `outcome_str`, `end_x`, `end_y`, `pass_ty
|
|
|
131
131
|
|
|
132
132
|
Extends `IndividualOnBallEvent`. Adds: `duel_type` (offensive/defensive/unspecified), `with_opponent` (bool).
|
|
133
133
|
|
|
134
|
-
### TackleEvent
|
|
134
|
+
### TackleEvent (removed in 0.8.0)
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
`TackleEvent` extended `IndividualCloseToBallEvent` with no additional fields.
|
|
137
|
+
Version 0.8.0 removed the class, so `databallpy.events` now exports
|
|
138
|
+
`DribbleEvent`, `IndividualCloseToBallEvent`, `IndividualOnBallEvent`,
|
|
139
|
+
`PassEvent` and `ShotEvent` only.
|
|
137
140
|
|
|
138
141
|
## Expected Threat (xT)
|
|
139
142
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
DataBallPy is a Python package for loading, synchronizing, and analyzing soccer event and tracking data. Developed by Alexander Oonk and Daan Grob, licensed under MIT. Current version: 0.
|
|
5
|
+
DataBallPy is a Python package for loading, synchronizing, and analyzing soccer event and tracking data. Developed by Alexander Oonk and Daan Grob, licensed under MIT. Current version: 0.8.1.
|
|
6
6
|
|
|
7
7
|
Its key distinguishing feature is **smart synchronization of tracking and event data** using the Needleman-Wunsch algorithm (borrowed from bioinformatics sequence alignment), which preserves event ordering during alignment. Naive cost-function approaches do not guarantee this.
|
|
8
8
|
|
|
@@ -25,12 +25,14 @@ Its key distinguishing feature is **smart synchronization of tracking and event
|
|
|
25
25
|
|
|
26
26
|
| Provider | `event_data_provider` | Precise Timestamps | Notes |
|
|
27
27
|
|---|---|---|---|
|
|
28
|
-
| Opta | `"opta"` | Yes | F24 (events) + F7 (metadata) XML files |
|
|
28
|
+
| Opta | `"opta"` | Yes | F24 (events) + F7 (metadata) XML files. Since 0.8.0 the same parser also accepts Stats Perform's newer MA13 (events) + MA2 (metadata) XML pair; the format is detected from the XML root tag, so the `f24_loc`/`f7_loc` arguments take either pair. |
|
|
29
|
+
| Stats Perform | `"statsperform"` | Yes | Alias of `"opta"`, behaving identically. |
|
|
29
30
|
| Metrica | `"metrica"` | Yes | Has open data support |
|
|
30
31
|
| Instat | `"instat"` | No | |
|
|
31
32
|
| SciSports | `"scisports"` | No | No separate metadata file needed |
|
|
32
33
|
| Sportec/DFL | `"dfl"` or `"sportec"` | Yes | |
|
|
33
34
|
| StatsBomb | `"statsbomb"` | No | Requires event_match_loc + event_lineup_loc |
|
|
35
|
+
| FIFA | `"fifa"` | | Listed as a supported `event_data_provider` by `get_game()`. |
|
|
34
36
|
|
|
35
37
|
### Kloppy Integration (v0.7.0+)
|
|
36
38
|
|
|
@@ -65,7 +67,7 @@ game = get_open_game(provider="sportec", game_id="J03WMX")
|
|
|
65
67
|
- **Sync quality depends on data quality**: If ball_status is wrong, timestamps imprecise, or tracking data starts late, sync degrades.
|
|
66
68
|
- **No Second Spectrum native parser**: Must use Kloppy bridge.
|
|
67
69
|
- **Video export requires ffmpeg**: `save_tracking_video` needs ffmpeg installed.
|
|
68
|
-
- **
|
|
70
|
+
- **Deprecations completed in v0.8.0**: the `Match` class and the standalone feature functions (`add_velocity`, `add_acceleration`, `add_team_possession`, `get_covered_distance`, `get_pitch_control`, `get_approximate_voronoi`, `filter_tracking_data` and the rest) were removed. Use `Game` and the equivalent methods on `TrackingData`. Code written for 0.7.x that imports them from `databallpy.features` will not run on 0.8.x.
|
|
69
71
|
- **Strict coordinate validation**: Pandera schema validation on load can reject data with positions slightly outside expected bounds.
|
|
70
72
|
- **Performance**: Some features iterate frame-by-frame in Python (Voronoi, pressure), which can be slow for full-game tracking data at 25 Hz (~135,000 frames).
|
|
71
73
|
- **Soccer only**: Despite the generic name, no support for other sports.
|
package/docs/fast-forward/api.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source_url: https://fast-forward.readthedocs.io/en/latest/api/
|
|
3
3
|
source_type: crawled
|
|
4
|
-
upstream_version: 0.
|
|
5
|
-
crawled_at: 2026-
|
|
4
|
+
upstream_version: 0.3.0
|
|
5
|
+
crawled_at: 2026-08-31T00:11:18.551Z
|
|
6
6
|
---
|
|
7
7
|
## TrackingDataset
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ Examples:
|
|
|
31
31
|
>>> dataset.periods # pl.DataFrame (2+ rows)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
### tracking `property`
|
|
34
|
+
### tracking `property` `fastforward._dataset.TrackingDataset.tracking`
|
|
35
35
|
|
|
36
36
|
```
|
|
37
37
|
tracking
|
|
@@ -39,7 +39,7 @@ tracking
|
|
|
39
39
|
|
|
40
40
|
Get tracking data as a DataFrame.
|
|
41
41
|
|
|
42
|
-
### metadata `property`
|
|
42
|
+
### metadata `property` `fastforward._dataset.TrackingDataset.metadata`
|
|
43
43
|
|
|
44
44
|
```
|
|
45
45
|
metadata
|
|
@@ -47,7 +47,7 @@ metadata
|
|
|
47
47
|
|
|
48
48
|
Get metadata DataFrame (single row).
|
|
49
49
|
|
|
50
|
-
### teams `property`
|
|
50
|
+
### teams `property` `fastforward._dataset.TrackingDataset.teams`
|
|
51
51
|
|
|
52
52
|
```
|
|
53
53
|
teams
|
|
@@ -55,7 +55,7 @@ teams
|
|
|
55
55
|
|
|
56
56
|
Get teams DataFrame.
|
|
57
57
|
|
|
58
|
-
### players `property`
|
|
58
|
+
### players `property` `fastforward._dataset.TrackingDataset.players`
|
|
59
59
|
|
|
60
60
|
```
|
|
61
61
|
players
|
|
@@ -63,7 +63,7 @@ players
|
|
|
63
63
|
|
|
64
64
|
Get players DataFrame.
|
|
65
65
|
|
|
66
|
-
### periods `property`
|
|
66
|
+
### periods `property` `fastforward._dataset.TrackingDataset.periods`
|
|
67
67
|
|
|
68
68
|
```
|
|
69
69
|
periods
|
|
@@ -71,7 +71,7 @@ periods
|
|
|
71
71
|
|
|
72
72
|
Get periods DataFrame with period_id, start_frame_id, end_frame_id.
|
|
73
73
|
|
|
74
|
-
### engine `property`
|
|
74
|
+
### engine `property` `fastforward._dataset.TrackingDataset.engine`
|
|
75
75
|
|
|
76
76
|
```
|
|
77
77
|
engine
|
|
@@ -79,7 +79,7 @@ engine
|
|
|
79
79
|
|
|
80
80
|
Get the DataFrame engine ('polars', 'pyspark', or 'arrow').
|
|
81
81
|
|
|
82
|
-
### coordinate_system `property`
|
|
82
|
+
### coordinate_system `property` `fastforward._dataset.TrackingDataset.coordinate_system`
|
|
83
83
|
|
|
84
84
|
```
|
|
85
85
|
coordinate_system
|
|
@@ -87,7 +87,7 @@ coordinate_system
|
|
|
87
87
|
|
|
88
88
|
Get the current coordinate system.
|
|
89
89
|
|
|
90
|
-
### orientation `property`
|
|
90
|
+
### orientation `property` `fastforward._dataset.TrackingDataset.orientation`
|
|
91
91
|
|
|
92
92
|
```
|
|
93
93
|
orientation
|
|
@@ -95,7 +95,7 @@ orientation
|
|
|
95
95
|
|
|
96
96
|
Get the current orientation.
|
|
97
97
|
|
|
98
|
-
### pitch_dimensions `property`
|
|
98
|
+
### pitch_dimensions `property` `fastforward._dataset.TrackingDataset.pitch_dimensions`
|
|
99
99
|
|
|
100
100
|
```
|
|
101
101
|
pitch_dimensions
|
|
@@ -103,7 +103,7 @@ pitch_dimensions
|
|
|
103
103
|
|
|
104
104
|
Get current pitch dimensions (length, width) in meters.
|
|
105
105
|
|
|
106
|
-
### to_polars
|
|
106
|
+
### to_polars `fastforward._dataset.TrackingDataset.to_polars`
|
|
107
107
|
|
|
108
108
|
```
|
|
109
109
|
to_polars()
|
|
@@ -113,7 +113,7 @@ Convert all DataFrames to Polars.
|
|
|
113
113
|
|
|
114
114
|
If already using Polars engine, returns self unchanged. Arrow tables are converted zero-copy via `pl.from_arrow` (Arrow C Data Interface capsule). PySpark DataFrames go via pandas (the round trip the JVM side wants).
|
|
115
115
|
|
|
116
|
-
### to_pyspark
|
|
116
|
+
### to_pyspark `fastforward._dataset.TrackingDataset.to_pyspark`
|
|
117
117
|
|
|
118
118
|
```
|
|
119
119
|
to_pyspark(spark=None)
|
|
@@ -123,7 +123,7 @@ Convert all DataFrames to PySpark.
|
|
|
123
123
|
|
|
124
124
|
If already using PySpark engine, returns self unchanged. Arrow tables go straight via `spark.createDataFrame(arrow_table)` (Spark 3.4+). Polars DataFrames convert through the Arrow capsule, skipping pandas.
|
|
125
125
|
|
|
126
|
-
### transform
|
|
126
|
+
### transform `fastforward._dataset.TrackingDataset.transform`
|
|
127
127
|
|
|
128
128
|
```
|
|
129
129
|
transform(to_orientation=None, to_dimensions=None, to_coordinates=None)
|
|
@@ -231,8 +231,8 @@ Parameters:
|
|
|
231
231
|
| `only_alive` | `bool` | If True, only include frames where ball is in play (matches kloppy default) | `True` |
|
|
232
232
|
| `include_empty_frames` | `bool` | If True, include frames with no detected players | `False` |
|
|
233
233
|
| `include_game_id` | `bool or str` | If True, add game_id column to tracking_df, team_df, and player_df from metadata. If False, no game_id column is added. If str, use the provided string as the game_id value. | `True` |
|
|
234
|
-
| `include_ball_owning_player` | `bool` | If True, attach a `ball_owning_player_id` column to the tracking DataFrame carrying the player UUID currently in possession on each frame (null when SkillCorner did not record one).
|
|
235
|
-
| `include_is_detected` | `bool` | If True, attach an `is_detected` column to the tracking DataFrame (long / long_ball layouts) indicating whether each player position was camera-detected (True) or imputed/extrapolated (False). Ball rows in long layout receive null since the concept doesn't apply. Wide layout doesn't surface the flag yet; long or long_ball is recommended for detection-aware analyses.
|
|
234
|
+
| `include_ball_owning_player` | `bool` | If True, attach a `ball_owning_player_id` column to the tracking DataFrame carrying the player UUID currently in possession on each frame (null when SkillCorner did not record one). Pass False to omit the column. | `True` |
|
|
235
|
+
| `include_is_detected` | `bool` | If True, attach an `is_detected` column to the tracking DataFrame (long / long_ball layouts) indicating whether each player position was camera-detected (True) or imputed/extrapolated (False). Ball rows in long layout receive null since the concept doesn't apply. Wide layout doesn't surface the flag yet; long or long_ball is recommended for detection-aware analyses. Pass False to omit the column. | `True` |
|
|
236
236
|
| `engine` | `('polars', 'pyspark', 'arrow', 'arrow[spark]')` | DataFrame engine to use: - "polars": Return Polars DataFrames (default) - "pyspark": Return PySpark DataFrames - "arrow": Return pyarrow.Tables with Polars-style Arrow types (string_view, duration[ms]). For Dask/Ray workers. - "arrow[spark]": Return pyarrow.Tables pre-normalized for Spark consumption (string, int64 ms). For Spark mapInArrow UDFs. | `"polars"` |
|
|
237
237
|
| `spark_session` | `SparkSession` | PySpark SparkSession to use. If None and engine="pyspark", will get or create a session automatically. | `None` |
|
|
238
238
|
|
|
@@ -257,7 +257,7 @@ Parameters:
|
|
|
257
257
|
| `orientation` | `str` | Coordinate orientation: - "static_home_away": Home attacks right (+x) entire match - "static_away_home": Away attacks right (+x) entire match - "home_away": Home attacks right 1st half, left 2nd half - "away_home": Away attacks right 1st half, left 2nd half - "attack_right": Attacking team always attacks right - "attack_left": Attacking team always attacks left | `"static_home_away"` |
|
|
258
258
|
| `only_alive` | `bool` | If True, only include frames where ball is in play (matches kloppy default) | `True` |
|
|
259
259
|
| `include_game_id` | `bool or str` | If True, add game_id column to tracking_df, team_df, and player_df from metadata. If False, no game_id column is added. If str, use the provided string as the game_id value. | `True` |
|
|
260
|
-
| `include_officials` | `bool` | If True, include officials in player_df with team_id="officials" and position codes: REF (Main Referee), AREF (Assistant Referee), VAR (Video Assistant Referee), AVAR (Assistant VAR),
|
|
260
|
+
| `include_officials` | `bool` | If True, include officials in player_df with team_id="officials" and position codes: REF (Main Referee), AREF (Assistant Referee), VAR (Video Assistant Referee), AVAR (Assistant VAR), FOURTH (Fourth Official) | `False` |
|
|
261
261
|
| `engine` | `('polars', 'pyspark', 'arrow', 'arrow[spark]')` | DataFrame engine to use: - "polars": Return Polars DataFrames (default) - "pyspark": Return PySpark DataFrames - "arrow": Return pyarrow.Tables with Polars-style Arrow types (string_view, duration[ms]). For Dask/Ray workers. - "arrow[spark]": Return pyarrow.Tables pre-normalized for Spark consumption (string, int64 ms). For Spark mapInArrow UDFs. | `"polars"` |
|
|
262
262
|
| `spark_session` | `SparkSession` | PySpark SparkSession to use. If None and engine="pyspark", will get or create a session automatically. | `None` |
|
|
263
263
|
|
|
@@ -455,7 +455,7 @@ Parameters:
|
|
|
455
455
|
| `orientation` | `str` | Coordinate orientation | `"static_home_away"` |
|
|
456
456
|
| `only_alive` | `bool` | If True, only include frames where ball is in play | `True` |
|
|
457
457
|
| `include_game_id` | `Union[bool, str]` | If True, add game_id column from metadata. If False, no game_id column is added. If str, use the provided string as the game_id value. | `True` |
|
|
458
|
-
| `include_officials` | `bool` | If True, include match officials (referees) in the players DataFrame with team_id="officials" and appropriate position codes (REF, AREF,
|
|
458
|
+
| `include_officials` | `bool` | If True, include match officials (referees) in the players DataFrame with team_id="officials" and appropriate position codes (REF, AREF, FOURTH). | `False` |
|
|
459
459
|
| `engine` | `('polars', 'pyspark', 'arrow', 'arrow[spark]')` | DataFrame engine to use: - "polars": Return Polars DataFrames (default) - "pyspark": Return PySpark DataFrames - "arrow": Return pyarrow.Tables with Polars-style Arrow types (string_view, duration[ms]). For Dask/Ray workers. - "arrow[spark]": Return pyarrow.Tables pre-normalized for Spark consumption (string, int64 ms). For Spark mapInArrow UDFs. | `"polars"` |
|
|
460
460
|
| `spark_session` | `SparkSession` | PySpark SparkSession to use. If None and engine="pyspark", will get or create a session automatically. | `None` |
|
|
461
461
|
|