Search by

pierdolabs / codice-fiscale-names

pierdomenicoguarnieri

Dizionario di nomi e cognomi per paese e provincia italiana (Wikidata + statistiche ufficiali), usato da pierdolabs/codice-fiscale per CodiceFiscale::suggestNames().

Package info

github.com/PierdoLabs/codice-fiscale-names

pkg:composer/pierdolabs/codice-fiscale-names

Statistics

Installs: 66

Dependents: 1

Suggesters: 1

Stars: 0

Open Issues: 0

v1.0.3 2026-11-30 17:21 UTC

This package is auto-updated.

Last update: 2026-11-30 17:21:46 UTC


README

English · Italiano

A data-only package for pierdolabs/codice-fiscale: it contains the dictionary of first names and surnames with their frequencies, by country and by Italian province. The library uses it in CodiceFiscale::suggestNames() to suggest the most likely first names and surnames for a fiscal code.

The dictionary is a separate package because it weighs about 24 MB. If you only use the library to generate, validate or decode, you don't need to download it.

composer require pierdolabs/codice-fiscale pierdolabs/codice-fiscale-names

There is nothing to configure: the library finds the package by itself. To use a copy of the data in another folder: PierdoLabs\CodiceFiscale\Names::setDataDir('/path/data').

Contents

data/ contains one TSV file per scope:

File Scope
WLD.tsv world, Wikidata only
<ISO3>.tsv one country (ITA, FRA, ESP, …, including former states such as SUN, YUG)
IT-<code>.tsv one Italian province (IT-RM, IT-MT, …), by municipality of birth

Each row matches one triplet of the fiscal code, with the names sorted by frequency:

G<triplet>\t<name>|<wd_m>|<wd_f>|<off_m>|<off_f>;<name>|...     first names
S<triplet>\t<surname>|<wd>|<off>;<surname>|...                 surnames
  • wd: number of people on Wikidata. In the country files it counts citizenship, in the province files the municipality of birth.
  • off: counts from official statistics, summed over every available year. They can be births or residents, depending on the source.
  • Spellings that are the same for the fiscal code are already merged: Mariagrazia is counted as Maria Grazia.

The format is meant to be read from any language. The scoring algorithm is described in the library README, section "Most likely first names and surnames".

Updating

The files are rebuilt from the main library with composer build-names, which writes to ../codice-fiscale-names/data (or to the folder in CF_NAMES_DIR). Then a new version of this package is published with a tag.

Licences and attributions

The dictionary is a derived work from several sources, each with its own licence. Anyone reusing this data must credit all of them and keep the NOTICE. The compilation is released under CC BY 4.0.

Source Country Licence / attribution
Wikidata (via QLever) all CC0
ISTAT, Contanomi Italy CC BY 4.0, © ISTAT
Municipal open data (Vittorio Veneto, Unione Valle Savio, Bergamo, Brescia, Matera, Lecce and 60 municipalities on the Maggioli platform) Italy CC0 / CC BY 4.0, © the respective municipalities
INSEE, Fichier des prénoms France Licence Ouverte 2.0, "Source : Insee"
INE, nombres de la población Spain "Fuente: INE (www.ine.es)"
Statbel Belgium CC BY 4.0, "Source: Statbel"
FSO/BFS, STATPOP Switzerland "Source: FSO – STATPOP"
SSB Norway CC BY 4.0, Statistics Norway
SCB Sweden CC BY 4.0, Statistics Sweden
ONS England and Wales Open Government Licence v3.0, "Source: Office for National Statistics"
Statistik Austria Austria Statistik Austria terms of use (free use, including commercial, with the source credited): "Source: STATISTIK AUSTRIA; data processed"
UCI Gender by Name (DOI 10.24432/C55G7X) USA, Canada, Australia CC BY 4.0

No data comes from leaks or from scraping of social networks.

Contributing

Read the contributing guide and the code of conduct. To report a missing or wrong name, open an issue; for questions use Discussions. Changes in each version are in the CHANGELOG.