gen

command
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Command gen builds internal/catalog/catalog_gen.go from a published Android device catalogue.

The mapping from a model code to a marketing name is assigned by the manufacturer and cannot be derived, so it can only be imported. What separates an imported catalogue from one somebody made up is the citation, which is why -source is required and is written into the generated file as catalog.Source.

Two inputs are understood, and may be combined:

gen -csv supported_devices.csv -source "Google Play supported devices, 2026-08-08"
gen -md MobileModels/brands    -source "KHwang9883/MobileModels (CC BY-NC-SA 4.0)"

The CSV is Google Play's supported-devices list, which ships as UTF-16LE with a BOM — the broad source, and the one whose licence permits redistribution. The -md directory is KHwang9883/MobileModels, a hand-maintained set of Markdown pages listing the codes each handset ships under; it reaches the regional variants the Play list omits. Only its English pages are read, and any row naming a device in CJK script is dropped whichever source produced it: a catalogue that answers in two scripts cannot be aggregated, sorted or displayed by one caller.

Given both, the CSV decides: where the two disagree about a code, the source that can be redistributed wins, and the Markdown only adds codes the CSV never held. Both are reduced to the same three columns.

MobileModels is CC BY-NC-SA 4.0. A catalogue built with -md inherits that — non-commercial, share-alike — which is not the licence of this repository's code. Whoever runs it with -md is choosing that for the generated file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL