A Python-based tool for creating and importing datasets into the I14Y platform of the Swiss Federal Statistical Office (BFS).
- Generate Excel templates for dataset input with data validation
- Import datasets from Excel files to I14Y API
- Support for required DCAT fields:
- Title and Description (DE)
- Identifiers
- Access Rights
- Publication Dates
- Support for optional fields:
- Keywords
- Contact Points
- Themes
- Spatial Coverage
- Temporal Coverage
- Distributions (up to 3)
- Python 3.8+
- pip package manager
- Clone this repository:
git clone [repository-url]
cd bfs/2025_02_batchimport
- (Optional but recommended) Create and activate a virtual environment:
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Configure the application:
- Edit
src/config.py
with your I14Y API token and organization ID
- Edit
Create a new Excel template for data input:
python src/create_template.py
This will generate data/template_datasets.xlsx
with data validation and reference sheets.
- Fill in the Excel template with your dataset information
- Log in on the interoperability platform. Copy the token clicking on the profile symbol. Fill in the token in the file config.py. Also provide the identifier of your organsation.
- Run the import script:
python src/import_datasets.py
The script will process each row and display real-time progress and error messages in the terminal.
2025_02_batchimport/
├── data/
│ └── datasets.xlsx
├── src/
│ ├── config.py
│ ├── create_template.py
│ └── import_datasets.py
├── requirements.txt
└── README.md
Please ensure any pull requests or contributions adhere to the following guidelines:
- Keep the code simple and well-documented
- Follow PEP 8 style guidelines
- Include appropriate error handling
- Test thoroughly before submitting