Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A scraper of statistical data from, built on top of Statscraper.

Project description

This is a scraper for statistical data from the ([] built on top of the `Statscraper package <>`.

The scraper is limited to the data avialble through


.. code:: bash

$ pip install viltolyckor_scraper

Example usage

.. code:: python

from viltolyckor import ViltolyckorScraper

# Init scraper
scraper = ViltolyckorScraper()

# List all available datasets
datasets = scraper.items
# [<ViltolyckorDataset: viltolyckor per viltslag>]

# Select a dataset
dataset = scraper.items["viltolyckor per viltslag"]

# List all available dimensions
datasets = verksamhetsform.dimensions
# [<Dimension: region>, <Dimension: year>, <Dimension: month>, <Dimension: viltslag>]

# Make a query
res = dataset.fetch() # Get latest available data for whole country by default

# Analyze the results with Pandas
df = res.pandas

# Make a more specific query
# Get data for a given period
res = dataset.fetch({"period": "2015"})

# Or from a specific region (all years)
res = ds.fetch({"region": u"Stockholms län", "year": "*"})


Set up:

.. code:: bash

$ pip install -r requirements.txt

Run tests:

.. code:: bash

$ make tests

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for viltolyckor_scraper, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size viltolyckor_scraper-0.1.0.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page