This is a scraper for statistical data from http://api.kolada.se/v2/ built on top of the Statscraper package <https://github.com/jplusplus/statscraper>.
Install
pip install -r requirements.txt
Example usage
from kolada import KoladaScraper
scraper = KoladaScraper()
dataset = scraper.items["N00002"] # pass a KPI id
# Query by year
data = dataset.fetch({
'period': [2016, 2015],
})
# ...or by municipality
towns = [x.value for x in dataset.dimensions['municipality'].allowed_values]
data = dataset.fetch({
'municipality': towns[:5],
})
# ... or by both
data = dataset.fetch({
'period': [2016, 2015],
'municipality': towns[:5],
})
# And then do something with the results.
print(data.pandas)
TODO
Add more allowed values
Implement errors when unallowed values are passed
Implement regions
Update chunkify() function, to make url building better
Metadata
Release files for kolada_scraper 0.0.4
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 | |
|---|---|---|---|---|
| kolada_scraper-0.0.4.tar.gz | 3.0 kB | Without provenance | Details |
Release files / kolada_scraper-0.0.4.tar.gz
| Download URL | kolada_scraper-0.0.4.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16e72eea43b057f735d99634349bfc314e4d46156e8bddb3762eb3e4430816f2
|
|
BLAKE2b-256 checksum How to use checksums |
c7ae3781a96bd201eab255b9eb10779411038627f8b83dcc66851ecc6708fbfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kolada_scraper 0.0.4
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.