pierdolabs / codice-fiscale-names
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
Requires
- php: >=7.3
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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:
Mariagraziais counted asMaria 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.