CLI tool to download aggregated data from SIAPE website.
Project description
SIAPE-CLI
SIAPE-cli is a Python package designed to facilitate interaction with the SIAPE website. This tool allows users to download and filter data related to energy efficiency certifications of buildings in Italy.
Features
- Filter building-related data using geolocation, qualitative features, climatic zones, and other criteria.
- Enforce admissible combinations for filter options.
- Download results as a CSV file with customizable filenames.
Installation
From PyPI
pip install siape-cli
After installation, the package provides a download command to filter and export building-related data.
Command-Line Interface (CLI)
You can invoke the CLI using the siape-cli command:
siape-cli download [OPTIONS]
Options
| Option | Description | Allowed Values |
|---|---|---|
-g, --geolocation |
Filter by geolocation (region or province). | reg, prov |
-q, --qualitative_features |
Filter by qualitative features (years, surface, or both). | y, s, ys |
-r, --resid |
Filter by building type (Residential/Non-Residential). | res, non-res |
-z, --zon_cli_filter |
Filter by climatic zones. | - |
-yl, --year_emission_lower |
Lower bound for EPC year of emission (Year >= 2015). | Integer (>= 2015) |
-yu, --year_emission_upper |
Upper bound for EPC year of emission (Year >= 2015). | Integer (>= 2015) |
-d, --dp412 |
Filter by law DP412/93. | - |
-n, --nzeb |
Filter by NZEB buildings only. | - |
-o, --output |
Specify output file name (default: <timestamp>.csv). |
- |
Examples
-
Download data for residential buildings in regions:
siape-cli download -g reg -r res
-
Filter by climatic zone and qualitative features:
siape-cli download -z -q ys
-
Download NZEB buildings data and save as
nzeb_data.csv:siape-cli download -n -o nzeb_data.csv
-
Filter using
dp412law in provinces:siape-cli download -d -g prov
Rules and Restrictions
To maintain data integrity, the tool enforces the following admissible combinations:
reg
prov
y
s
ys
zc
dp412
reg, zc
reg, prov
reg, prov, zc
y, zc
s, zc
dp412, reg
dp412, prov
dp412, zc
dp412, y
dp412, s
dp412, ys
Using an invalid combination will produce an error:
NotAdmissibleCombination: Combination of arguments <args_set> is not admissible.
Contribution
Contributions are welcome! So far only the main filtering arguments have been implemented, and more features can be added to enhance the tool. Follow these steps to get started:
- Open an issue to discuss the feature/fix.
- Fork the repository.
- Create a new branch for your feature/fix.
- Commit your changes and push the branch.
- Open a pull request for review.
Notes for developers
This project uses [Poetry](https://python-poetry.org/) for dependency management. To install the required dependencies, run: git clone https://github.com/NauelSerraino/SIAPE.git
cd SIAPE
poetry install
poetry shell # Activate the virtual environment
To test the package, run:
siape-cli download
Note: The command will reflect the latest changes made to the package.
To run the tests, use:
python test/test_cli_mock.py
python test/test_cli.py
License
This project is licensed under the MIT License.
Project details
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 siape_cli-0.2.2.tar.gz.
File metadata
- Download URL: siape_cli-0.2.2.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Linux/6.8.0-52-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01daf0aa07dc606654c21ea22482b4d32e155cf4ea1784dc37b5352f96acb698
|
|
| MD5 |
5bb4436d171ac66f4d4b23474890512d
|
|
| BLAKE2b-256 |
df506be12c069ecd2df2689901965e6f8e5117b4bdf1b404a04ec6add1392f07
|
File details
Details for the file siape_cli-0.2.2-py3-none-any.whl.
File metadata
- Download URL: siape_cli-0.2.2-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Linux/6.8.0-52-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66387f6eb58b463e1ab4a97f4da5ec8a9412fd10406a824f4ff60bfdf3882a85
|
|
| MD5 |
76c23b86763be1f85660d5083110b48f
|
|
| BLAKE2b-256 |
423029aa6e58cffc9ca11d134554c2d48cf6bba6e459363b1af3c7fdaab26a57
|