├── img └── export.png ├── .github └── workflows │ └── export.yml └── README.md /img/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowTheyVote/data/HEAD/img/export.png -------------------------------------------------------------------------------- /.github/workflows/export.yml: -------------------------------------------------------------------------------- 1 | name: Publish Current Export 2 | on: 3 | workflow_dispatch: 4 | schedule: 5 | - cron: '0 2 * * 6' 6 | 7 | jobs: 8 | export: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Store Current Date 12 | id: date 13 | run: echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" 14 | - name: Checkout Data Repository 15 | uses: actions/checkout@v4 16 | - name: Configure `git` 17 | run: | 18 | git config user.name htv-bot 19 | git config user.email mail@howtheyvote.eu 20 | - name: Create new Commit and tag it 21 | env: 22 | DATE: ${{ steps.date.outputs.DATE }} 23 | run: | 24 | git commit --allow-empty -m "Export from $DATE" 25 | git push 26 | git tag "$DATE" 27 | git push origin tag "$DATE" 28 | - name: Download current export 29 | run: | 30 | wget https://howtheyvote.eu/files/export/export.zip 31 | unzip -o -d export export.zip 32 | gzip export/*.csv 33 | - name: Release 34 | uses: softprops/action-gh-release@v2 35 | with: 36 | tag_name: ${{ steps.date.outputs.DATE }} 37 | body_path: ./export/README.md 38 | files: | 39 | export.zip 40 | export/*.csv.gz 41 | export/last_updated.txt 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HowTheyVote.eu Dataset 2 | 3 | HowTheyVote.eu collects data about European Parliament roll-call votes and related data such as biographical information about MEPs and political groups. We provide our dataset in CSV format. 4 | 5 | **[Read more about HowTheyVote.eu and our data license.](https://howtheyvote.eu/about)** 6 | 7 | > [!TIP] 8 | > In case of questions or feedback, please feel free to open a [ticket](https://github.com/HowTheyVote/howtheyvote/issues/new?template=Blank+issue&labels=data)! 9 | > You can also reach out via email: mail at howtheyvote.eu 10 | > In case you encounter an **error in our data**, please use [this form](https://tally.so/r/w2eb1M?type=Incorrect+vote+results&link=https%3A%2F%2Fhowtheyvote.eu) to report it! 11 | 12 | ## Latest Exports 13 | 14 | To download the current dataset click [here](https://github.com/HowTheyVote/data/releases/latest). 15 | 16 | There, you will find the documentation for each data export. At the bottom of each export, you can download all files as a single `export.zip` file. 17 | 18 | ![](img/export.png) 19 | 20 | ## Stable Links 21 | 22 | Besides downloading the whole export as a single `.zip` file, you can also download individual files. 23 | 24 | These are provided as `csv.gz` files and are e.g., useful for scripting purposes. For example, the URL `https://github.com/HowTheyVote/data/releases/latest/download/votes.csv.gz` will always link to the latest available `Votes` CSV. 25 | 26 | ### How to: Load the export files into `pandas` 27 | 28 | As an illustration, using these stable links, the following snippet shows how you can load the `Votes` table from our export into a `pandas` dataframe. Executing this code will always load the latest available version of this file. 29 | 30 | ```python 31 | import pandas as pd 32 | votes_df = pd.read_csv('https://github.com/HowTheyVote/data/releases/latest/download/votes.csv.gz', compression='gzip') 33 | votes_df.head() 34 | ``` 35 | 36 | We also provide a file called `last_updated.txt`, in which the creation time of the export is stored as a timestamp. --------------------------------------------------------------------------------