Documentation
¶
Overview ¶
Package enrich enriches a spreadsheet with gender/age/nationality predictions from the public API, joining results back onto the original rows. It mirrors the Demografix browser tool's column names and semantics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServiceNames ¶
ServiceNames lists the enabled services in canonical order.
Types ¶
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError is a user-facing validation/column-resolution failure. The CLI maps it to a usage exit code.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
type Options ¶
type Options struct {
InputPath string
OutputPath string
Gender bool
Age bool
Nationality bool
NameCol string
FirstCol string
LastCol string
CountryCol string
FixedCountry string
TopN int
Prefix string
Resume bool
Concurrency int
}
Options are the enrich command inputs.
type PlanInfo ¶
type PlanInfo struct {
InputFormat string
OutputFormat string
OutputPath string
Rows int
Services []string
NameColumns string
Country string
OutputColumns []string
Cost int
Resume bool
}
PlanInfo describes a run without executing it (for --dry-run).
type Predictor ¶
type Predictor interface {
Genderize(ctx context.Context, names []string, country string) ([]api.GenderizePrediction, api.Quota, error)
Agify(ctx context.Context, names []string, country string) ([]api.AgifyPrediction, api.Quota, error)
Nationalize(ctx context.Context, names []string) ([]api.NationalizePrediction, api.Quota, error)
}
Predictor is the subset of the API client the pipeline needs. *api.Client satisfies it; tests inject a fake.
Click to show internal directories.
Click to hide internal directories.