Read-only mirror of https://github.com/metadata-swiss/harvester_FSVO — Bundesamt für Statistik. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-07-03 11:13:43 +02:00
.github/workflows small update 2025-07-03 11:13:43 +02:00
src various updates 2025-06-25 11:41:36 +02:00
README.md Update README.md 2025-06-25 13:42:37 +02:00
requirements.txt Update requirements.txt 2025-03-09 18:28:33 +01:00

I14Y Harvester for the FSVO data repository

Features

  • Automated harvesting (import new dataset and update existing datasets) via scheduled GitHub Actions.
  • field mapping from DDI to DCAT
  • script to harvest DDI datasets in json format

Configuration

Environment Variables Navigate to your GitHub repository:

  • Settings → Secrets → Actions
  • Add the following secrets (provided via encrypted email):
    • CLIENT_ID_PROD, CLIENT_SECRET_PROD (Production)
    • CLIENT_ID_ABN, CLIENT_SECRET_ABN (ABN)

File Configuration Edit src/config.py:

PUBLISHER_ID = "your-publisher-id"  # Provided by BFS
HARVESTER_API_URL = ""  # API endpoint 

Workflow

  • The frequency at which the workflow runs is defined in the .github/workflow files.
  • To trigger manually, go to GitHub → Actions → [Workflow] → Run Workflow.
  • After each run, a log file is generated and uploaded as an artifact, which can be downloaded from the Actions tab.

Setting for PROD

To set up the github action workflow fpr PROD, you just need to:

  • uncomment the first line of the script .github/workflows/harvester_prod.yml and comment those lines in .github/workflows/harvester_abn.yml.
  • chose the PROD API base URL in src/config.py

Repository Structure

harvester_template/
├── .github/workflows                # GitHub Actions workflows fpr ABN and PROD
│   ├── harvester_abn.yml
│   └── harvester_prod.yml
├── src/ 
│    ├── config.py                   # Global settings 
│    ├── harvester.py                # Active harvester
│    └── field_mapping.py            # DDI to DCAT mapping
├── requirements.txt                 # Python dependencies 
└── README.md                        # This file