football-docs 0.9.1 → 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.
Files changed (144) hide show
  1. package/README.md +11 -9
  2. package/data/docs.db +0 -0
  3. package/dist/crawl.d.ts +7 -0
  4. package/dist/crawl.js +48 -1
  5. package/dist/discover.d.ts +8 -0
  6. package/dist/discover.js +12 -1
  7. package/dist/http.d.ts +8 -1
  8. package/dist/http.js +23 -1
  9. package/dist/ingest.js +3 -1
  10. package/dist/provider-truth.d.ts +7 -0
  11. package/dist/provider-truth.js +15 -1
  12. package/dist/tools.d.ts +7 -0
  13. package/dist/tools.js +14 -1
  14. package/docs/databallpy/data-model.md +5 -2
  15. package/docs/databallpy/overview.md +5 -3
  16. package/docs/fast-forward/api.md +6 -6
  17. package/docs/fast-forward/benchmarks.md +2 -2
  18. package/docs/fast-forward/concepts-coordinate-systems.md +2 -2
  19. package/docs/fast-forward/concepts-dataset.md +2 -2
  20. package/docs/fast-forward/concepts-distributed-compute.md +2 -2
  21. package/docs/fast-forward/concepts-filelike.md +2 -2
  22. package/docs/fast-forward/concepts-layouts.md +2 -2
  23. package/docs/fast-forward/concepts-orientations.md +2 -2
  24. package/docs/fast-forward/concepts-transformations.md +2 -2
  25. package/docs/fast-forward/getting-started.md +2 -2
  26. package/docs/fast-forward/index.md +2 -2
  27. package/docs/fast-forward/providers-cdf.md +2 -2
  28. package/docs/fast-forward/providers-gradientsports.md +2 -2
  29. package/docs/fast-forward/providers-hawkeye.md +2 -2
  30. package/docs/fast-forward/providers-optavision.md +2 -2
  31. package/docs/fast-forward/providers-respovision.md +2 -2
  32. package/docs/fast-forward/providers-scisports.md +2 -2
  33. package/docs/fast-forward/providers-secondspectrum.md +2 -2
  34. package/docs/fast-forward/providers-signality.md +2 -2
  35. package/docs/fast-forward/providers-skillcorner.md +4 -8
  36. package/docs/fast-forward/providers-sportec.md +3 -3
  37. package/docs/fast-forward/providers-statsperform.md +2 -2
  38. package/docs/fast-forward/providers-tracab.md +2 -2
  39. package/docs/fast-forward/providers.md +2 -2
  40. package/docs/fast-forward/reporting-issues.md +2 -2
  41. package/docs/fmdb-pro/api-access.md +10 -1
  42. package/docs/fmdb-pro/data-model.md +6 -2
  43. package/docs/free-sources/overview.md +1 -1
  44. package/docs/mplsoccer/overview.md +5 -1
  45. package/docs/mplsoccer/visualizations.md +27 -0
  46. package/docs/skillcorner/api-access.md +7 -4
  47. package/docs/skillcorner/api-endpoints.md +3 -3
  48. package/docs/skillcorner/concepts.md +3 -3
  49. package/docs/skillcorner/coordinate-system.md +3 -3
  50. package/docs/skillcorner/data-model.md +17 -4
  51. package/docs/skillcorner/identity-surfaces.md +3 -3
  52. package/docs/skillcorner/physical-data.md +3 -3
  53. package/docs/sportmonks/api-changes.md +267 -0
  54. package/docs/sportmonks/authentication.md +61 -0
  55. package/docs/sportmonks/best-practices.md +416 -0
  56. package/docs/sportmonks/changelog-beta.md +156 -0
  57. package/docs/sportmonks/changelog.md +907 -0
  58. package/docs/sportmonks/code-libraries.md +28 -0
  59. package/docs/sportmonks/data-corrections.md +33 -0
  60. package/docs/sportmonks/demo-response-files.md +131 -0
  61. package/docs/sportmonks/differences-between-api-2-and-api-3.md +29 -0
  62. package/docs/sportmonks/endpoints.md +427 -0
  63. package/docs/sportmonks/error-codes.md +897 -0
  64. package/docs/sportmonks/filtering-and-complexity-exceptions.md +15 -0
  65. package/docs/sportmonks/filtering.md +35 -0
  66. package/docs/sportmonks/fixtures.md +36 -0
  67. package/docs/sportmonks/get-all-fixtures.md +271 -0
  68. package/docs/sportmonks/get-all-leagues-by-team-id.md +260 -0
  69. package/docs/sportmonks/get-all-leagues.md +260 -0
  70. package/docs/sportmonks/get-all-livescores.md +270 -0
  71. package/docs/sportmonks/get-all-seasons.md +261 -0
  72. package/docs/sportmonks/get-all-states.md +307 -0
  73. package/docs/sportmonks/get-all-types.md +252 -0
  74. package/docs/sportmonks/get-brackets-by-season-id.md +897 -0
  75. package/docs/sportmonks/get-current-leagues-by-team-id.md +235 -0
  76. package/docs/sportmonks/get-fixture-by-id.md +267 -0
  77. package/docs/sportmonks/get-fixtures-by-date-range-for-team.md +287 -0
  78. package/docs/sportmonks/get-fixtures-by-date-range.md +298 -0
  79. package/docs/sportmonks/get-fixtures-by-date.md +300 -0
  80. package/docs/sportmonks/get-fixtures-by-head-to-head.md +288 -0
  81. package/docs/sportmonks/get-fixtures-by-multiple-ids.md +288 -0
  82. package/docs/sportmonks/get-fixtures-by-search-by-name.md +270 -0
  83. package/docs/sportmonks/get-inplay-livescores.md +270 -0
  84. package/docs/sportmonks/get-latest-updated-fixtures.md +327 -0
  85. package/docs/sportmonks/get-latest-updated-livescores.md +335 -0
  86. package/docs/sportmonks/get-league-by-id.md +241 -0
  87. package/docs/sportmonks/get-leagues-by-country-id.md +256 -0
  88. package/docs/sportmonks/get-leagues-by-fixture-date.md +260 -0
  89. package/docs/sportmonks/get-leagues-by-live.md +241 -0
  90. package/docs/sportmonks/get-leagues-search-by-name.md +260 -0
  91. package/docs/sportmonks/get-past-fixtures-by-tv-station-id.md +293 -0
  92. package/docs/sportmonks/get-seasons-by-id.md +242 -0
  93. package/docs/sportmonks/get-seasons-by-search-by-name.md +261 -0
  94. package/docs/sportmonks/get-seasons-by-team-id.md +256 -0
  95. package/docs/sportmonks/get-state-by-id.md +241 -0
  96. package/docs/sportmonks/get-type-by-entity.md +221 -0
  97. package/docs/sportmonks/get-type-by-id.md +237 -0
  98. package/docs/sportmonks/get-upcoming-fixtures-by-market-id.md +293 -0
  99. package/docs/sportmonks/get-upcoming-fixtures-by-tv-station-id.md +294 -0
  100. package/docs/sportmonks/getting-started.md +357 -0
  101. package/docs/sportmonks/include-exceptions.md +16 -0
  102. package/docs/sportmonks/includes.md +107 -0
  103. package/docs/sportmonks/leagues.md +931 -0
  104. package/docs/sportmonks/livescores.md +29 -0
  105. package/docs/sportmonks/making-your-first-request.md +840 -0
  106. package/docs/sportmonks/meta-description.md +61 -0
  107. package/docs/sportmonks/nested-includes.md +248 -0
  108. package/docs/sportmonks/new-endpoints-and-data-features.md +70 -0
  109. package/docs/sportmonks/ordering-and-sorting.md +114 -0
  110. package/docs/sportmonks/other-exceptions.md +16 -0
  111. package/docs/sportmonks/overview.md +17 -0
  112. package/docs/sportmonks/rate-limit.md +1078 -0
  113. package/docs/sportmonks/request-options.md +29 -0
  114. package/docs/sportmonks/seasons.md +35 -0
  115. package/docs/sportmonks/selecting-and-filtering.md +169 -0
  116. package/docs/sportmonks/selecting-fields.md +275 -0
  117. package/docs/sportmonks/states.md +30 -0
  118. package/docs/sportmonks/statistics.md +26 -0
  119. package/docs/sportmonks/syntax-and-filters.md +425 -0
  120. package/docs/sportmonks/syntax.md +63 -0
  121. package/docs/sportmonks/translations-beta.md +133 -0
  122. package/docs/sportmonks/types.md +25 -0
  123. package/docs/sportmonks/what-can-you-do-with-sportmonks-data.md +175 -0
  124. package/docs/sportradar/data-model.md +16 -1
  125. package/docs/statsbomb/api-access.md +12 -7
  126. package/docs/statsbomb/api-endpoints.md +2 -2
  127. package/docs/statsbomb/identity-surfaces.md +1 -1
  128. package/docs/statsbomb/iq-metrics-glossary.md +1 -1
  129. package/docs/statsbomb/player-mapping.md +1 -1
  130. package/docs/statsbomb/player-match-stats.md +1 -1
  131. package/docs/statsbomb/player-season-stats.md +1 -1
  132. package/docs/statsbomb/team-match-stats.md +1 -1
  133. package/docs/statsbomb/team-season-stats.md +1 -1
  134. package/docs/transferroom/api-access.md +27 -10
  135. package/docs/transferroom/api-endpoints.md +56 -41
  136. package/docs/transferroom/data-model.md +2 -2
  137. package/docs/transferroom/identity-surfaces.md +2 -2
  138. package/docs/wyscout/api-access.md +10 -3
  139. package/docs/wyscout/api-endpoints.md +2 -2
  140. package/docs/wyscout/coordinate-system.md +2 -2
  141. package/docs/wyscout/data-model.md +32 -2
  142. package/docs/wyscout/event-types.md +2 -2
  143. package/package.json +18 -26
  144. package/providers.json +41 -11
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 | 251 | overview, getting-started, data-model, coordinate-system, orientations, layouts, transformations, distributed-compute, api-reference, 12 provider format pages |
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 | 161 | event-types, data-model, coordinate-system, api-access, api-endpoints, charting-analysis-metrics, glossary, identity-surfaces |
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
116
  | floodlight | 144 | core data objects, io parsers (Tracab, DFL, Kinexon, Opta, SkillCorner, StatsBomb, StatsPerform, Second Spectrum), transforms, metrics, models, visualisation, guides |
117
- | SportMonks | 82 | event-types, data-model, api-access, charting-season-stories, identity-surfaces |
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 | 64 | overview, pitch-types, visualizations |
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 | 48 | api-access, api-endpoints, data-model, physical-data, coordinate-system, concepts, identity-surfaces |
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 | 29 | api-access, api-endpoints, data-model, charting-and-stories, integration-notes |
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
- **1,808 searchable chunks** across 23 providers and tools.
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 three API versions merge into one
170
- truth file, because its docs legitimately span v2, v3 and v4.
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
@@ -248,6 +248,24 @@ export function htmlToMarkdown(html, url) {
248
248
  return turndown.turndown(article.content);
249
249
  }
250
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
+ }
251
269
  /**
252
270
  * Crawl an llms.txt or llms-full.txt file.
253
271
  * Already structured for LLM consumption — chunk by top-level heading.
@@ -255,10 +273,33 @@ export function htmlToMarkdown(html, url) {
255
273
  export function crawlLlmsTxt(content, sourceUrl) {
256
274
  const sections = [];
257
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;
258
292
  let currentTitle = "overview";
259
293
  let currentLines = [];
294
+ fenced = false;
260
295
  for (const line of lines) {
261
- const headingMatch = line.match(/^(#{1,2})\s+(.+)/);
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
+ }
262
303
  if (headingMatch && currentLines.length > 0) {
263
304
  const body = currentLines.join("\n").trim();
264
305
  if (body.length > 50) {
@@ -621,6 +662,12 @@ async function main() {
621
662
  console.log(` → no content extracted`);
622
663
  continue;
623
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;
624
671
  for (const doc of docs) {
625
672
  writeCrawledDoc(name, doc, config.version);
626
673
  console.log(` wrote ${name}/${doc.category}.md (${doc.content.length} chars) [${doc.source_type}]`);
@@ -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
- /** Check if a URL returns a successful response. */
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
- /** Check if a URL returns a successful response. */
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
- fm[key] = cleaned || null;
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
  }
@@ -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.
@@ -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
- "fast-forward": ["REF", "AREF", "VAR", "AVAR"],
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
- return `**Source:** ${row.source_type}${row.source_url ? ` (${row.source_url})` : ""}${row.upstream_version ? ` | v${row.upstream_version}` : ""}${crawledAt}`;
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
- Extends `IndividualCloseToBallEvent`. No additional fields.
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.7.3.
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
- - **Deprecation in progress (v0.7.x to v0.8.0)**: `Match` class deprecated in favour of `Game`. Standalone feature functions deprecated in favour of methods on `TrackingData`.
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.
@@ -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.2.0
5
- crawled_at: 2026-08-11T09:09:50.139Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.551Z
6
6
  ---
7
7
  ## TrackingDataset
8
8
 
@@ -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). Omitting the kwarg currently behaves as False but emits a `FutureWarning`; pass an explicit value to silence the warning. | `False (will become True in fastforward 0.2.0)` |
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. Omitting the kwarg currently behaves as False but emits a `FutureWarning`; pass an explicit value to silence the warning. | `False (will become True in fastforward 0.2.0)` |
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), 4TH (Fourth Official) | `False` |
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, 4TH). | `False` |
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
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/benchmarks/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.139Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.550Z
6
6
  ---
7
7
  Performance comparison between **fast-forward** (Rust core) and **kloppy** (pure Python) across all supported providers.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/coordinate-systems/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.140Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.551Z
6
6
  ---
7
7
  fast-forward supports 14 named coordinate systems that map to 6 unique coordinate system definitions. Many providers use the same underlying system (CDF), just with different names.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/dataset/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.138Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.550Z
6
6
  ---
7
7
  The `TrackingDataset` is the central object returned by every provider's `load_tracking()` function. It contains all tracking data and metadata. The underlying type of each table (Polars, PySpark, or pyarrow) is determined by the `engine` kwarg passed to `load_tracking`.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/distributed-compute/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.141Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.552Z
6
6
  ---
7
7
  Engine choice depends on the consumer:
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/filelike/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.140Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.551Z
6
6
  ---
7
7
  All `load_tracking()` functions accept `FileLike` parameters for their input files. `FileLike` is a flexible type from [kloppy](https://kloppy.pysport.org/reference/io/#kloppy.io.FileLike) that lets you pass data in several ways:
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/layouts/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.140Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.551Z
6
6
  ---
7
7
  fast-forward supports three DataFrame layouts that determine how tracking data is structured. Choose based on your analysis needs.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/orientations/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.140Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.552Z
6
6
  ---
7
7
  Orientation controls the attacking direction of teams in the coordinate space. In real matches, teams switch sides at halftime. Orientation settings let you normalize this so your analysis doesn't need to handle side-switching manually.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/concepts/transformations/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.141Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.552Z
6
6
  ---
7
7
  The `TrackingDataset.transform()` method lets you change the coordinate system, orientation, or pitch dimensions of your tracking data after loading.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/getting-started/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.137Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.549Z
6
6
  ---
7
7
  ## Installation
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.135Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.546Z
6
6
  ---
7
7
  ![fast-forward](https://fast-forward.readthedocs.io/en/assets/logos/fastforward-gradient-logo.png)
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/providers/cdf/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.141Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.552Z
6
6
  ---
7
7
  The **Common Data Format (CDF)** is fast-forward's internal standardized format. Use this provider to load data that is already in CDF format.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/providers/gradientsports/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.141Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.553Z
6
6
  ---
7
7
  Load tracking data from **GradientSports (PFF)** format.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/providers/hawkeye/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.141Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.553Z
6
6
  ---
7
7
  Load tracking data from **HawkEye** per-minute file format.
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/providers/optavision/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.142Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.553Z
6
6
  ---
7
7
  Load tracking data from **OptaVision** (StatsPerform's FIFA EPTS format).
8
8
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  source_url: https://fast-forward.readthedocs.io/en/latest/providers/respovision/
3
3
  source_type: crawled
4
- upstream_version: 0.2.0
5
- crawled_at: 2026-08-11T09:09:50.142Z
4
+ upstream_version: 0.3.0
5
+ crawled_at: 2026-08-31T00:11:18.553Z
6
6
  ---
7
7
  Load tracking data from **Respovision** JSONL format. Unique among providers: metadata is embedded in the tracking file.
8
8