A tool for navigating and processing the microdata od Banca d'Italia: Indagine sul Bilancio dell Famiglie Italiane
Project description
Banca d'Italia Microdata Extractor – Indagine sui Bilanci delle Famiglie Italiane (BFI)
This project provides tools for navigating and processing the Banca d'Italia microdata from the survey "Bilanci delle famiglie italiane" (BFI). It includes a Python class BIMicrodataExtractor with structured methods to explore, query, and analyze the BFI dataset efficiently.
📦 Project Structure
The central component is the BIMicrodataExtractor class, which offers:
- 🚀 Simplified access to the dataset structure
- 🧠 Attribute encoding utilities
- 🔎 Filtering and pairing logic for household members
- 📊 Joint and conditional distribution tools
- 📁 Integration-ready design for larger analytical pipelines
📚 Dataset Overview
Bilanci delle famiglie italiane (BFI) is an biennial survey by Banca d'Italia capturing detailed financial aspects of Italian households. It includes information on:
- Demographics
- Employment, unemployment and pension conditions
- Families earnings, passive income and transfer income
- Housing conditions (rent, property, loan)
- Family debts
- Family wealth and assets
- Payment options
- Saving solutions
- Families expenses
- Insurance solutions
After loading the data in the BIMicrodataExtractor class, the information relative to the families in general will be stored in the attribute df_families, while the information about the single members of the families will be stored in the attribute df_familymembers.
🧩 Key Features of BIMicrodataExtractor
| Method/Attribute | Description |
|---|---|
load_data() |
Loads and prepares the AVQ microdata from raw files |
attribute_categories |
Attribute that contains all the categories for the attributes |
get_attribute_metadata() |
Retrieves metadata/encodings for categorical variables |
get_attributes_by_categories() |
Filters attributes by categories |
filter() |
Applies logical filters on individual-level records |
pair_family_members() |
Pairs individuals within the same household according to flexible rules |
joint_distribution() |
Computes joint/marginal distributions for selected variables |
Installing & Setup
git clone git@github.com:Clearbox-AI/bancaitalia-microdata-extractor.git
pip install -r path/to/bancaitalia-microdata-extractor/requirements.txt
pip install -e path/to/bancaitalia-microdata-extractor
To setup your AVQ ISTAT Microdata, unzip the data folder you find here and provide the path to the unzipped folder to the load_data() method of your BIMicrodataExtractor class to get started!
Unlike raw data, this data was processed to allow some methods of the class BIMicrodataExtractor to work smoothly.
Updating version
To update your local version go to your local folder and run:
git pull origin main
pip install -e bancaitalia-microdata-extractor
📊 Examples
from microdata_extractor import BIMicrodataExtractor
# Supposing your AVQ Microdata ISTAT is stored in "BFI_2022"
# After loading the data, the class bfi will features two attributes being:
# - bfi.df_families (with information about the families)
# - bfi.df_familymembers (with information about the single members of the families)
mde = BIMicrodataExtractor()
mde.load_data("BFI_2022")
# Consult the available attribute categories
mde.attribute_categories
# Filter attributes by relevant categories
_ = mde.get_attributes_by_categories("demographics","unemployment" condition="or")
# Check encodings for categorical variables
_ = mde.get_attribute_metadata("STUDIO", print_output=True)
_ = mde.get_attribute_metadata("OCCNOW", print_output=True)
# Compute the joint probability distributions of STUDIO (education level) and OCCNOW (employed/not employed)
# Compute it only for adults at the time of th esurvay (2022) -> born before 2003 (ANASC<=2003)
rules = [("ANASC","<=",2003)]
df_prob = mde.joint_distribution(attrs=["STUDIO","OCCNOW"], df=mde.df_familymembers, conditions=rules)
Contacts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file BI-microdata-extractor-0.0.1.tar.gz.
File metadata
- Download URL: BI-microdata-extractor-0.0.1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a044d4dfe44831ec2ac1311ba025726b8e39bcbec6e36c8680cefa3114d0dd
|
|
| MD5 |
84b241e726a822ed599454d5a9b084f6
|
|
| BLAKE2b-256 |
5d99c46c039973618495474749d2c7ea53b336cdbf7d2a525d9c04fc833502ff
|
File details
Details for the file BI_microdata_extractor-0.0.1-py3-none-any.whl.
File metadata
- Download URL: BI_microdata_extractor-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c399d20f64adfee811179dcf4564fedaf2a29f041cc73d0be37197668047e4ff
|
|
| MD5 |
36764c409b84e0f21ef62c32b2a7c576
|
|
| BLAKE2b-256 |
e3724553a7acddce8aa5633e8859adc2751686f39eea6f1e831ebe365182e123
|