This is a scraper for statistical data from the (https://www.viltolycka.se/statistik/viltolyckor-for-respektive-viltslag/)[viltolycka.se] built on top of the Statscraper package <https://github.com/jplusplus/statscraper>.
The scraper is limited to the data avialble through https://www.viltolycka.se/statistik/viltolyckor-for-respektive-viltslag/
Install
$ pip install viltolyckor_scraper
Example usage
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": "*"})
Develop
Set up:
$ pip install -r requirements.txt
Run tests:
$ make tests
Deployment
To deploy a new version to PyPi:
Update version in setup.py
Build: python3 setup.py sdist bdist_wheel
Upload: python3 -m twine upload dist/viltolyckor_scraper-X.Y.X*
…assuming you have Twine installed (pip install twine) and configured.
Metadata
Release files for viltolyckor-scraper 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| viltolyckor_scraper-0.2.0.tar.gz | 4.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| viltolyckor_scraper-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / viltolyckor_scraper-0.2.0.tar.gz
| Download URL | viltolyckor_scraper-0.2.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6539dab436d7bc6dd6347c1fd69aa3fd3a0a0d23aab85d9bada17eb45e3b58e4
|
|
BLAKE2b-256 checksum How to use checksums |
f7d4b49096b569f92d4a8cf3d41af88f9f2b82706b7aab7734f746d8cc8231cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
|
Release files / viltolyckor_scraper-0.2.0-py3-none-any.whl
| Download URL | viltolyckor_scraper-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e512e003d77b1cbcf1cd27371c19011aa70313f23e6a1a508dc190846eb15254
|
|
BLAKE2b-256 checksum How to use checksums |
eecd32ba25c09abf03b9b5b449d5792b5dac42264bd6f2da2e3ac7f66b69fc3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
|
Security for viltolyckor-scraper 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.