⚠️ Notice: The website previously linked here is no longer available as it is not relevant anymore. Please disregard any references to it.
This repository contains a Flask application designed for users to search for candidates who participated in the 2023 Nationalrat elections (Switzerland). It primarily showcases detailed information about a candidate, emphasizing the number of votes they received.
NRW23/
│
├── files/
│ └── NRW2023-kandidierende.zip # Data containing candidate information
│
├── static/
│ ├── JS/
│ │ └── script.js # JavaScript file for interactive features
│ │
│ └── styles.css # CSS file for the web application styling
│
├── templates/
│ ├── detail.html # Detail page template for a specific candidate
│ ├── index.html # Main page template for search feature
│ ├── privacy-policy.html # Privacy policy template
│ └── results.html # Results page displaying candidates
│
├── .gitignore # Patterns of files/directories to ignore in git
│
├── app.py # Main Flask app script
│
├── LICENSE # License file
│
├── main_routes.py # Routes for the Flask app
│
├── README.md # README documentation
│
├── requirements.txt # List of required Python packages for the app
│
└── utils.py # Utility functions for the app
-
Clone the Repository
git clone https://github.com/devobern/NRW23/tree/main
-
Navigate to Directory
cd NRW23
-
Create & Activate Virtual Environment
Ensure you havepython3
andvirtualenv
installed.virtualenv env source env/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Run the App
python run.py
-
Access Locally
The application will be accessible at http://127.0.0.1:5000/.Note: Due to the Content Security Policy (CSP), the app cannot be run locally without dev certificates. To address this, you can use mkcert to generate your own certificate. For a guide on how to use mkcert, please refer to this tutorial.
Online access is no longer available.
This application is an ongoing project and serves as a bit of a playground for me. It was developed with the primary motivation to provide a simple platform to view the votes received by individual candidates. There might be occasional issues or aspects that need refinement. Feedback and suggestions are always welcome.
This project is licensed under the MIT License - see the LICENSE file for details.
The data used in this repository is sourced from the Bundesamt für Statistik BFS and relates to the Nationalratswahlen 2023.
- Dataset Name: NR - Kandidierende
- Publication Date: 8. August 2023
- Format: JSON
- Access URL: Link to Dataset
The dataset is available under the "Freie Nutzung. Quellenangabe ist Pflicht" terms. Users can use this dataset for both non-commercial and commercial purposes, but proper attribution is required.
Attribution:
Autor:in: Bundesamt für Statistik BFS
Titel: NR - Kandidierende
Link zum Datensatz
For inquiries or suggestions, please reach out via email.