Skip to content

gcampanella/istat-demographics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Istat demographics

By Gianluca Campanella ([email protected])

Creative Commons License

The Italian National Institute of Statistics (Istat) collates demographic data from register offices, and makes them available through its demographics portal.

This repository contains a set of scripts to scrape and aggregate monthly time series of births, deaths, and net migration at municipality (comune) level, separately for men and women.

The data are made available under a Creative Commons Attribution 4.0 International (CC BY 4.0) licence, like the original data.

Usage

  1. Run the Scrapy script scrape.py:
    scrapy runspider -o istat-demographics-scraped.csv -t csv scrape.py
  2. Run the R script postprocess.R:
    R --vanilla < postprocess.R
    This will produce the output file istat-demographics.csv.gz
  3. Optionally, delete the file istat-demographics-scraped.csv

Data dictionary

The file istat-demographics.csv.gz contains the following variables:

Name Content
group NUTS 1 (group of regions) identifier
region NUTS 2 (region) identifier
province NUTS 3 / LAU 1 (province) identifier
municipality LAU 2 (municipality) identifier
year Year
month Month (1 = January, 12 = December)
sex Sex (M = Male, F = Female)
births Births
deaths Deaths
net_migration Net migration

Note: LAU identifiers are updated periodically; see this page (in Italian) for more details.

Releases

No releases published

Packages

No packages published