danish-football-clubs
v1.2.13
Published
Club data and DBU utilities for Danish youth football
Downloads
147
Maintainers
Readme
danish-football-clubs
A static dataset and utility library of 696 Danish football clubs, scraped from dbu.dk. Provides consistent club naming, SVG badge fallbacks, and DBU age-group utilities for football apps.
Built for and used in Opstillingen.dk — a lineup builder for Danish youth football coaches.
Installation
npm install github:rasmuslandgreen/danish-football-clubsTo update to the latest version:
npm update danish-football-clubsUsage
import { clubs, getClub, clubBadgeUrl, getULevel, getMatchFormat } from 'danish-football-clubs';Club data
// Full list of 696 clubs
clubs; // [{ name, city, postal, region, dbuId, color, logo }, ...]
// Exact-name lookup (returns a fallback stub if not found)
const club = getClub('Brøndby IF');
// { name: 'Brøndby IF', city: 'Brøndby', postal: '2605', region: 'Hovedstaden', dbuId: 3700, color: null, logo: null }Badge rendering
// SVG data URL — drop directly into an <img src>
const src = club.logo ?? clubBadgeUrl(club.name);
// <img src={src} alt={club.name} />When no logo is available, clubBadgeUrl returns a light grey circle with the club abbreviation in muted grey — same <img> tag either way.
Abbreviations
import { clubAbbreviation } from 'danish-football-clubs';
clubAbbreviation('FC København'); // FCK
clubAbbreviation('Boldklubben Vestia'); // BKV
clubAbbreviation('Vanløse IF'); // VIF
clubAbbreviation('B 1909'); // B1909DBU age groups
getULevel(2014); // 'U12'
getMatchFormat(2014); // '8v8'| Age | U-level | Format | |-----|---------|--------| | ≤ 7 | U7 | 3v3 | | ≤ 10 | U10 | 5v5 | | ≤ 12 | U12 | 8v8 | | 13+ | U13+ | 11v11 |
Club data model
{
"name": "Brøndby IF",
"city": "Brøndby",
"postal": "2605",
"region": "Hovedstaden",
"dbuId": 3700,
"primaryColor": null,
"secondaryColor": null,
"kitStyle": null,
"logo": null
}| Field | Description |
|---|---|
| region | One of: Hovedstaden, Sjælland, Fyn, Jylland, Bornholm |
| primaryColor | Primary brand colour as hex — null until set |
| secondaryColor | Secondary brand colour as hex — null until set |
| kitStyle | regular, vertical-stripes, horizontal-stripes, or half-split — null until set |
| logo | Not bundled — logos are served separately by dbuId from your own storage |
Stored shape (when a user selects a club)
{ "clubName": "Vanløse IF", "clubId": 1545, "clubSource": "dbu" }Custom club (typed but not found in the list):
{ "clubName": "Himmelev Boldklub", "clubId": null, "clubSource": "custom" }Logo workflow
- Export logos as PNG named by
dbuId(e.g.1567.png) - Drop files into
assets/logos/ - Run
npm run logos— updatesclubs.jsonand rebuildsindex.js
Supported formats: .png, .jpg, .jpeg, .svg, .webp
Scripts
npm run build # clubs.json → index.js
npm run logos # Scan assets/logos/ → update clubs.json + rebuild index.js
npm run scrape # Re-scrape dbu.dk → clubs.json (~60–90 min, requires Playwright)
npm run figma # Generate figma-plugin/code.js for the Figma badge artboard pluginSee SCRAPING.md for the full update workflow.
Development
clubs.json is the source of truth. index.js is generated — never edit it directly.
danish-football-clubs/
index.js # Generated — do not edit
clubs.json # Edit this, then run npm run build
assets/logos/ # Club logo images, named by dbuId
scripts/
scrapeClubs.js
buildIndex.js
mergeLogos.js
buildFigmaPlugin.js
figma-plugin/ # Generates one artboard per club in FigmaLicense
MIT © Rasmus Landgreen
