Skip to main content

ISTAT Microdata Extractor – Aspetti della Vita Quotidiana (AVQ)

This project provides tools for navigating and processing the ISTAT microdata. It includes the Python class ISTATMicrodataExtractor with structured methods to explore, query, and analyze the microdata efficiently.

Available microdata:

  • AVQ: Indagine sugli Aspetti della Vita Quotidiana (AVQ) delle famiglie italiane
  • HBS: Indagine sulle spese delle famiglie italiane

📦 Project Structure

The central component is the ISTATMicrodataExtractor 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

Aspetti della Vita Quotidiana (AVQ) is an annual survey by ISTAT capturing detailed aspects of daily life in Italian households. It includes information on:

  • Demographics
  • Education and employment
  • Health and access to services
  • Household composition and living conditions
  • Digital device usage and internet access
  • Family dynamics and caregiving
  • Purchase habits

🧩 Key Features of ISTATMicrodataExtractor

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/ISTAT-microdata-extractor.git

pip install -r path/to/ISTAT-microdata-extractor/requirements.txt

pip install -e path/to/ISTAT-microdata-extractor

Updating version

To update your local version go to your local folder and run:

git pull origin main

pip install -e ISTAT-microdata-extractor

To setup the data, unzip the data folder you need here and provide the path to the unzipped folder to the load_data() method of your ISTATMicrodataExtractor class.

Unlike raw data, this data was processed to allow some methods of the class BIMicrodataExtractor to work smoothly.

📊 Examples

from microdata_extractor import ISTATMicrodataExtractor

# Supposing your AVQ Microdata ISTAT is stored in "AVQ_2023_IT"
mde = ISTATMicrodataExtractor(df_name="AVQ",year=2023)
mde.load_data("AVQ_2023_IT")

# Consult the available attribute categories 
mde.attribute_categories

# Filter attributes by relevant categories
_ = mde.get_attributes_by_categories("demographics","sport", "health_conditions", condition="or")

# Check encodings for categorical variables
encoding = mde.get_attribute_metadata("FREQSPO", print_output=True)

# Filter main dataset based on user-defined rules
# Tuples within the same inner list are AND-ed, tuples belonging to different inner lists are OR-ed
# The following rules express: (age>=18 AND BMI<=3)  OR  (age<18 AND BMIMIN==1)
rules = [
    [("ETAMi",">=",7),("BMI","<=",3)],  # Adults (age>=18) AND BMI==[1,2,3]
                                        # OR
    [("ETAMi","<",7),("BMIMIN","==",1)] # minors (age<18) AND BMIMIN==1
]

df_filtered = mde.filter(rules)

Check out the Examples folder for more!

Contacts

📧 info@clearbox.ai

🌐 www.clearbox.ai

Metadata

Release files for microdata-extractor 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microdata-extractor 0.0.1
File Size Uploaded
microdata-extractor-0.0.1.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for microdata-extractor 0.0.1
File Interpreter ABI Platform
microdata_extractor-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / microdata-extractor-0.0.1.tar.gz

Download URL microdata-extractor-0.0.1.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bd3268f84e9855fabcba84252d0a257f416b0f784cc9821b0ecd920866a9b6e2
BLAKE2b-256 checksum
How to use checksums
0169ab152c4b85f75eef41398372de1f4fc92f738e3d21844a50fb80ec1b3688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release files / microdata_extractor-0.0.1-py3-none-any.whl

Download URL microdata_extractor-0.0.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
046bbf02e06bdf4be8fce6e26b46300e03737a471b222d815646b3b084c9659c
BLAKE2b-256 checksum
How to use checksums
81c7e4f3ad2ad49ee2aa0c4c80f6da0b66c017fd6b970e41532c7f8d43927f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page