onegov.swissvotes

Database for federal votes


License
GPL-2.0
Install
pip install onegov.swissvotes==0.0.25

Documentation

Onegov Swissvotes

Database for federal votes.

Dataset (CSV, XLSX)

The CSV and XLSX version of the dataset are cached on application level and regenerated only after updating the votes. The files are saved in the root of the filestorage. Old files are not deleted.

Managing Votes

Managing votes is done by uploading datasets. Modified votes are automatically updated and new votes added. Deleting existing votes can be done using the UI.

Full Text Search

Onegov Swissvotes uses Poppler + Postgres for full text search of attached PDFs.

If you want to reindex the attachments, you can run:

onegov-swissvotes reindex

Batch Upload Attachments

There is a command line command for batch-uploading and indexing attachments:

sudo -u [user] bin/onegov-swissvotes --select /onegov_swissvotes/[instance] import [folder]

The structure of the folder is expected to be in the form:

[folder]/[attribute]/[locale]/[bfs_number].pdf

The attribute may be any LocalizedFile attribute of the SwissVote model.

Run the Tests

Install tox and run it:

pip install tox
tox

Limit the tests to a specific python version:

tox -e py27

Install jest and run it:

npm install
npm t

To update the snapshots, run:

npm t -- -u

Conventions

Onegov Swissvotes follows PEP8 as close as possible. To test for it run:

tox -e pep8

Onegov Swissvotes uses Semantic Versioning

Build Status

Build Status

Coverage

Project Coverage

Latest PyPI Release

Latest PyPI Release

License

onegov.swissvotes is released under GPLv2