Ajouter une source de donnees¶
Les sources actuelles sont des templates de depart. Pour ajouter une autre source officielle ou ouverte, copiez le bloc le plus proche dans configs/sources.yml, changez l'identifiant et les details d'acces, puis lancez l'ingestion.
Procedure¶
- Trouver une URL officielle, une API, une collection STAC, un endpoint SPARQL ou une table BFS PX-Web.
- Choisir le type de connecteur.
- Ajouter un bloc sous
sources:dansconfigs/sources.yml. - Verifier avec
python scripts/ingest.py --list. - Executer
python scripts/ingest.py --source your_source_id. - Inspecter
data/raw/your_source_id/<timestamp>/payload.*etmetadata.json.
Types de connecteurs¶
| Cas | Type | Exemple a copier |
|---|---|---|
| Fichier direct CSV, HTML, PDF | http_file |
sfoe_energy_balance_csv |
| API JSON simple | http_json |
parliament_affairs |
| API JSON avec POST body | http_post_json |
aramis_armasuisse_research_projects |
| Package CKAN opendata.swiss | ckan_package_show |
opendata_swiss |
| Collection STAC | stac_collection |
meteo_swiss_smn |
| SPARQL JSON | sparql |
fedlex |
| SPARQL CSV | sparql_csv |
lindas |
| BFS PX-Web | pxweb_query |
bfs_pxweb |
Exemple minimal¶
my_csv_source:
source_name: My official CSV source
enabled: true
type: http_file
format: CSV
url: https://example.admin.ch/data.csv
suffix: csv
documentation:
url: https://example.admin.ch
access_path: Direct CSV download
license_or_terms: Check official terms
geographic_reference: Switzerland / dataset dependent
update_logic: Dataset dependent
Puis:
python scripts/ingest.py --source my_csv_source
Le fichier metadata.json doit toujours documenter l'origine, le chemin d'acces, la licence, la reference geographique et la logique de mise a jour.