utils.create_path_bucket
utils.create_path_bucket(
provider,
dataset_family,
source,
year,
borders,
crs,
filter_by,
value,
vectorfile_format,
territory,
simplification=0,
filename='raw',
bucket=BUCKET,
path_within_bucket=PATH_WITHIN_BUCKET,
)Path of a cartiflette file within the S3 storage.
The pipeline no longer produces GeoJSON files: this layout is kept to read the files already published (2022), and the API (api/) serves the same paths. Do not change it.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| provider | str | Provider of the data, “IGN”. | required |
| dataset_family | str | Dataset family, “ADMINEXPRESS”. | required |
| source | str | Source label, “EXPRESS-COG-CARTO-TERRITOIRE”. | required |
| year | int or str | Vintage. | required |
| borders | str | Level of the polygons (e.g. “DEPARTEMENT”). | required |
| crs | int or str | EPSG code. | required |
| filter_by | str | Level used to split the files (e.g. “REGION”). | required |
| value | str | Value of filter_by (e.g. “11”). |
required |
| vectorfile_format | str | “geojson” or “parquet”. | required |
| territory | str | “metropole” for every published file. | required |
| simplification | float | Simplification level, 0 or 50. | 0 |
| filename | str | Name of the file without extension, “raw”. | 'raw' |
| bucket | str | Bucket of the files. | BUCKET |
| path_within_bucket | str | Prefix within the bucket, “production” for the published files. | PATH_WITHIN_BUCKET |
Returns
| Name | Type | Description |
|---|---|---|
| str | Path “bucket/path_within_bucket/provider=…/raw.{format}”, to append to the S3 endpoint URL. |
Examples
>>> create_path_bucket(
... provider="IGN", dataset_family="ADMINEXPRESS",
... source="EXPRESS-COG-CARTO-TERRITOIRE", year=2025,
... borders="DEPARTEMENT", crs=4326, filter_by="REGION", value="11",
... vectorfile_format="parquet", territory="metropole",
... simplification=50,
... )
'projet-cartiflette/production/provider=IGN/.../simplification=50/raw.parquet'