Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ AnalisiOpenData - Open Data Analyzer

Python Streamlit License Repo Size Last Commit GitHub stars GitHub forks

DESCRIPTION

Python software development project for analyzing and extracting open data from the official dati.gov.it search portal.

MAIN FEATURES

Search Search and filtering of available datasets
CSV Analysis Automatic download and analysis of CSV data
Maps Geographic visualization of maps
Export Export to CSV and Excel formats
Modular Modular architecture well organized
Tests Complete test suite for validation
Config Centralized configuration for easy maintenance

INSTALLATION

Git Terminal

git clone https://github.com/1ESA1/AnalisiOpenData.git
cd AnalisiOpenData

REQUIREMENTS

Python Version Requests
Requests Call API
Pandas For manipulation data
Folium For interactive map
Support Extensible and Compatible

The dependencies are present in the file. requirements.txt.

pip install -r requirements.txt

USAGE

Streamlit πŸš€Click to Web App Live || Public URL

https://brluhecnkuvhp99tuzhzv3.streamlit.app/
cd src
streamlit run app.py

Localhost Local Access (Same Machine):

http://localhost:8501

Deploy to Streamlit Cloud - (External Users) - 🌐

1. Create Repository GitHub with your project
2. Sign Up Sign up at streamlit.io/cloud
3. New App Click "New app" and select your repository
4. Share URL Share the public URL with users worldwide

Steamlit Features Interface:

Search Interactive dataset search with keyword filtering
Browse Browse and select datasets from dati.gov.it
Analyze Analyze individual datasets or process all results
Maps View interactive maps for geographic data
Download Download analysis results as CSV
Statistics View data summaries and statistics

RUN

Version CLI
Modular bash cd src python main.py
Original bash cd src python AnalisiOpenData.py

Tests Application Testing

# Run all tests
cd tests
python run_unified_tests.py

# Specific tests
python test_config.py      # Configuration tests
python test_unified.py     # Unified tests
python test_utils.py       # Utility tests

πŸ“ OUTPUT

data/ JSON files with dataset metadata
output/mappa_incidenti.html Interactive map
output/output.xlsx Excel report
output/output.csv Data exported to CSV

πŸ† Improvements Implemented

Separation Independent and reusable components
Config Centralized settings
Error Robust error handling
Tests Complete test suite for validation
Docs Detailed documentation
Backward Legacy code maintained

πŸ—οΈ Project Structure

Module Architecture

AnalisiOpenData/
β”‚
β”œβ”€β”€ πŸ“ src/                   # Modular source code
β”‚   β”œβ”€β”€ 🎯 main.py              # Main control
β”‚   β”œβ”€β”€ βš™οΈ config.py              # Centralized configuration (URLs, paths, constants)
β”‚   β”œβ”€β”€ πŸ”Œ services.py            # API and data services
β”‚   β”œβ”€β”€ πŸ“„ file_manager.py        # File I/O management (JSON, CSV, Excel)
β”‚   β”œβ”€β”€ πŸ“Š analyzer.py            # Accident analysis
β”‚   β”œβ”€β”€ πŸ’¬ ui.py                  # User interface
β”‚   └── πŸ“œ AnalisiOpenData.py     # Original code (backup)
β”‚
β”œβ”€β”€ πŸ§ͺ tests/                 # Complete test suite
β”‚   β”œβ”€β”€ πŸ“„ base_test.py           # Base tests
β”‚   β”œβ”€β”€ πŸ“„ test_config.py         # Configuration tests
β”‚   β”œβ”€β”€ πŸ“„ test_unified.py        # Unified tests
β”‚   β”œβ”€β”€ πŸ“„ test_utils.py          # Test utilities
β”‚   └── πŸƒ run_unified_tests.py   # Unified test runner
β”‚
β”œβ”€β”€ πŸ“Š data/                  # Input data
β”‚   β”œβ”€β”€ πŸ“Š Condizioni.xlsx        # Weather conditions
β”‚   β”œβ”€β”€ πŸ“„ DatiGovIt.json         # Raw data from data.gov.it
β”‚   β”œβ”€β”€ πŸ“„ DatiGovItFiltrati.json # Filtered data
β”‚   └── πŸ“„ DatiSelezionati.json # Data selected for analysis
β”‚
β”œβ”€β”€ πŸ“ˆ output/                # Generated output files
β”‚   β”œβ”€β”€ πŸ—ΊοΈ mappa_incidenti.html   # Interactive map
β”‚   β”œβ”€β”€ πŸ“Š output.xlsx             # Excel report
β”‚   └── πŸ“„ output.csv             # Data exported to CSV
β”‚
β”œβ”€β”€ πŸ“– README.md              # Complete documentation
β”œβ”€β”€ πŸ“– CHANGELOG.md           # Updates documentation
└── πŸ“„ LICENSE                # Apache 2.0 License

Structure view:

tree -I '__pycache__' --dirsfirst

TEST AND QUALITY

  • βœ… Modules: 6/6 source files validated
  • βœ… Configuration: Working settings tests
  • βœ… Functionality: Core components tested
  • βœ… Integration: Complete system validated

Run All Tests

cd tests
python run_unified_tests.py

Individual Tests

cd tests
python test_config.py      # Configuration tests
python test_unified.py     # Unified tests
python test_utils.py       # Utility tests

Project Structure Verification

# Display project structure
tree -I '__pycache__'

# Check main files
ls -la src/
ls -la tests/
ls -la data/
ls -la output/

Contributing Report Issues Pull Requests Read CONTRIBUTING.md for the complete guidelines on how to contribute to the project.

GitHub License

About

Progetto applicativo scritto in codice Python per estrarre ed analizzare, tramite richieste API, Open Data dal portale ufficiale dati.gov.it

Topics

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages