buildingdata
Data-management layer for buildingmodel.
buildingdata delivers clean, ready-to-use building, demographic and weather
datasets for French building energy inference, and caches everything locally so
repeated calls don't re-download.
pip install buildingdata
Quick start
import buildingdata as bd
# One-time configuration (bucket, cache dir, credentials).
# The public bucket works anonymously, so this is optional.
bd.configure()
# Reference datasets (downloaded once from Google Cloud Storage, then cached)
census = bd.get_census() # INSEE census -> polars DataFrame
districts = bd.get_districts() # IRIS district geometry -> geopandas GeoDataFrame
diagnosis = bd.get_diagnosis() # ADEME energy diagnoses -> polars DataFrame
gas = bd.get_gas_network() # GRDF gas network routes -> geopandas GeoDataFrame
# On-demand datasets (fetched live from public APIs)
buildings = bd.get_bdtopo("751010101") # per-IRIS building geometry (IGN WFS)
epw = bd.get_era5_climate(48.85, 2.35, 2020) # ERA5 weather -> synthetic EPW
You can also configure from the command line:
buildingdata configure --bucket my-bucket --cache-dir ~/.cache/buildingdata
What it provides
| Function | Source | Returns |
|---|---|---|
get_census() |
INSEE census (GCS) | polars DataFrame |
get_districts() |
IRIS geometries (GCS) | geopandas GeoDataFrame |
get_diagnosis() |
ADEME energy performance diagnoses (GCS) | polars DataFrame |
get_gas_network() |
GRDF gas network routes (GCS) | geopandas GeoDataFrame |
get_bdtopo(iris_code) |
IGN Géoplateforme WFS (live) | geopandas GeoDataFrame |
get_era5_climate(lat, lon, year) |
Copernicus CDS (live) | path to EPW file |
Reference datasets are pulled from a public Google Cloud Storage bucket and cached locally with generation-based freshness checks. French geospatial data uses CRS EPSG:2154 (Lambert-93).
Configuration
Settings are resolved in the following precedence order:
- Explicit function arguments / CLI options
- Environment variables (
BUILDINGDATA_BUCKET,BUILDINGDATA_CACHE_DIR,GOOGLE_APPLICATION_CREDENTIALS) - Global configuration file (
~/.config/buildingdata/config.ini) - Dynamic defaults
Configurable settings:
- bucket — GCS bucket holding reference datasets (default:
building-inference-data) - cache directory — where downloaded data is stored locally
- credentials — path to a GCS service-account JSON (omit for anonymous access to the public bucket)
Cache Behavior & Multi-Project Sharing
- Default (Unconfigured): The cache directory is namespaced per installation (
~/.local/share/buildingdata/cache/<install-id>on Linux/macOS). Each virtualenv or package installation receives its own unique cache subfolder to prevent collisions between environments. - Sharing Across Projects: To share a single cache directory across multiple repositories, virtualenvs, or Snakemake pipelines, set the
BUILDINGDATA_CACHE_DIRenvironment variable or write a global configuration file:
# Via CLI (writes ~/.config/buildingdata/config.ini):
buildingdata configure --cache-dir /path/to/shared/cache
# Or via environment variable:
export BUILDINGDATA_CACHE_DIR="/path/to/shared/cache"
Because ~/.config/buildingdata/config.ini is stored in your home directory, configuring it once applies globally to all projects and virtual environments for your user account.
Installation extras
pip install "buildingdata[era5]" # ERA5 weather (cdsapi, xarray, pvlib, ...)
pip install "buildingdata[docs]" # build the Sphinx documentation
Requires Python ≥ 3.10.
License
Released under the MIT License.
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 buildingdata-0.2.1.tar.gz.
File metadata
- Download URL: buildingdata-0.2.1.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0d98d3f2ab00bf7b8b0c3ab33a8c34ad3bd2b8fd14c372a5a74afd69d71b97
|
|
| MD5 |
5a4acfeecaa4d90059bae362aaa23971
|
|
| BLAKE2b-256 |
7efbdb94bfe03727f0a53b445043a8d2d6932f117e35c9243c5863262421e662
|
File details
Details for the file buildingdata-0.2.1-py3-none-any.whl.
File metadata
- Download URL: buildingdata-0.2.1-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f5d6fd138739015bc9b7f1b4bc7f941d2c7934c74fe7d4517267ddc556a7e64
|
|
| MD5 |
a24bdbd6fa10853e7ec1353e1dfb5c0e
|
|
| BLAKE2b-256 |
525dc228c6c5a8c5c2e73c5223fe88f64467912c52f019737e99fab6932d4d38
|