This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

SHIP - Swiss Healthcare Insurance Premiums

Provides access to the official records for the health-insurance premiums provided by the Bundesamt für Gesundheit (BAG).

SHIP tries to do two things right:

  • Parses the CSV files that we acquired by asking the BAG and puts them into the SQL Database of your choice, renaming certain fields (because we think that ‘franchise’ is better than ‘F’ and ‘canton’ better than ‘C_ID’).
  • Makes it easy to run a number of queries against the database. The idea is to gather useful queries and routines with the goal to eventually provide a nice API.

Under Development

Currently, SHIP is under development, which is why the following instructions are meant for developers. Expect this README to grow in the future.

Installation

Create Project

mkdir ship && cd ship
git clone git://github.com/seantis/ship.git .

Install SHIP

(Virtualenv or Virtualenvrwapper are highly recommended)

virtualenv -p python2.7 --no-site-packages .
source bin/activate
python setup.py develop

Test SHIP

python setup.py test

Usage

There’s an interactive example using IPython notebook in the “docs” folder. Read docs/example.txt for further instructions.

For now it is best to get a database running, grab a coffee and read the source.

To get a simple sqlite database running:

from ship import config
config.connect('sqlite:///premiums.db')

from ship import load
load.all()

To understand the data read models/premium.py and db.py

Import latest data

The latest data for the Swiss healthinsurance premiums are not yet publically available, but they will be soon. Currently to get them one has to contact the Swiss governement.

The data they release is a mixture of csv and xls files. To import them into ship one has to do the following:

  1. Check if the data structure has changed.

    Compare Doku_PraemienDaten.txt in the data release with ship/rawdata/doku_praemien_daten.txt. The field descriptions should match.

  2. Copy the premiums.

    Praemien_CH.csv and Praemien_EU.csv can be used without changes. Just copy them to the ship/rawdata folder, renaming them appropriately. E.g. if 2014 rename them as follows:

    Praemien_CH.csv -> ship/rawdata/2014_ch.csv
    Praemien_EU.csv -> ship/rawdata/2014_eu.csv
    

    The first line (headers) may be omitted, though it should also work with the header line present.

  3. Copy the insurers.

    Open the Praemien_CH.xls file, select the “(G)” sheet, and copy the columns “G_ID” and “G_KBEZ” to the new 2014_insurers.csv file. Use semicolons as separator. When in doubt, check the insurers file of a previous year.

  4. Copy the towns.

    The towns and the regions they are in can be acquired through the following website:

    http://www.priminfo.ch/praemien/regionen/de/index.php

    From the B_NPA_2014 copy PLZ, Ortsbezeichnung, Kanton, BFS-Nr., Region and Gemeinde into a csv in the same format as the insurers in step three.

    Note that the BFS-Nr. comes before the region. The column order must be as follows:

    PLZ, Ortsbezeichnung, Kanton, BFS-Nr., Region, Gemeinde

    Store this as ship/rawdata/2014_towns.csv

  5. Adjust the test.

    Add the newly added year to ship/tests/test_db.py and run python setup.py test. If there’s an unicode error you should save the csv files using UTF-8 encoding.

License

This project is released under the GPL v3. See LICENSE.txt.

Changelog

0.3

  • Rerelase of 0.3rc2

0.3rc2

  • Fixes data not being served when executing ‘map-run’

0.3rc1

  • Includes insurance data for 2014
  • Moves map example inside the module, including it on PyPI.

0.2

  • Inclues insurance data for 2013

0.1

  • Includes insurance data for 2012
Release History

Release History

0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3rc2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3rc1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ship-0.3.tar.gz (8.1 MB) Copy SHA256 Checksum SHA256 Source Feb 18, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting