Skip to content

Parser for XML files in (various) eCH formats of the political rights domain.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

statistikZH/eCHparser

Repository files navigation

eCHparser

tic License: MIT

Convert XML files containing data in the eCH-0252 standard format to easy-to-use dataframes using the eCHparser package.

Installation

You can install the development version of eCHparser from GitHub with:

# install.packages("devtools")
devtools::install_github("statistikZH/eCHparser")

Example: eCH-0252

The eCH-0252 standard is used to feed voting data from cantonal IT systems to the voteInfo API, which then uses the data to display live vote counting information, for example via the voteInfo App or the Results and Information Plattform of the Canton of Zurich. This data will be publicly available in this format starting in 2025. However, example files are already available in this package (see example bellow).

The function parse_eCH_0252() allows users to transform these XML files to easy-to-use dataframes.

library(eCHparser)

# list all sample files
example_files <- system.file("extdata", package = "eCHparser") |>
  list.files()

# pick a random sample file
file <- sample(seq_along(example_files), 1)

# define filepath to sample file
filepath <- system.file("extdata", testfiles[file], package = "eCHparser")

# parse file, using only federal and cantonal votes
vote_df <- parse_eCH_0252(filepath, doi = c("CH", "CT"))

About

Parser for XML files in (various) eCH formats of the political rights domain.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages