Python software development project for analyzing and extracting open data from the official dati.gov.it search portal.
git clone https://github.com/1ESA1/AnalisiOpenData.git
cd AnalisiOpenData| Version Requests | |
| Call API | |
| For manipulation data | |
| For interactive map | |
| Extensible and Compatible |
The dependencies are present in the file. requirements.txt.
pip install -r requirements.txthttps://brluhecnkuvhp99tuzhzv3.streamlit.app/
cd src
streamlit run app.pyhttp://localhost:8501
Deploy to Streamlit Cloud - (External Users) - π
| 1. | GitHub with your project | |
| 2. | Sign up at streamlit.io/cloud | |
| 3. | Click "New app" and select your repository | |
| 4. | Share the public URL with users worldwide |
Steamlit Features Interface:
| Version | CLI |
|---|---|
| Modular | bash cd src python main.py |
| Original | bash cd src python AnalisiOpenData.py |
# 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 testsdata/ |
JSON files with dataset metadata |
output/mappa_incidenti.html |
Interactive map |
output/output.xlsx |
Excel report |
output/output.csv |
Data exported to CSV |
| Independent and reusable components | |
| Centralized settings | |
| Robust error handling | |
| Complete test suite for validation | |
| Detailed documentation | |
| Legacy code maintained |
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- β Modules: 6/6 source files validated
- β Configuration: Working settings tests
- β Functionality: Core components tested
- β Integration: Complete system validated
cd tests
python run_unified_tests.pycd tests
python test_config.py # Configuration tests
python test_unified.py # Unified tests
python test_utils.py # Utility tests# Display project structure
tree -I '__pycache__'
# Check main files
ls -la src/
ls -la tests/
ls -la data/
ls -la output/
Read CONTRIBUTING.md for the complete guidelines on how to contribute to the project.