A scraper of statistical data from uc.se, built on top of Statscraper.
Project description
This is a non-official scraper for statistical data from the (https://www.uc.se/konkursstatistik)[uc.se] built on top of the Statscraper package <https://github.com/jplusplus/statscraper>.
The scraper is limited to the data availble through https://www.uc.se/konkursstatistik
Install
$ pip install uc_scraper
Example usage
from uc import UCScraper
# Init scraper
scraper = UCScraper()
# List all available datasets
print(scraper.items)
# [<UCDataset: Riks- och länsstatistik (b'Riks- och l\xc3\xa4nsstatistik')>, <UCDataset: Kommunstatistik (b'Kommunstatistik')>, <UCDataset: Branschstatistik (b'Branschstatistik')>]
# Select a dataset
dataset = scraper.items["Branschstatistik"]
# List all available dimensions
print(dataset.dimensions)
#
# Make a query
res = dataset.fetch() # Get latest available data by default
# Analyze the results with Pandas
df = res.pandas
# You are able to query month ranges
res = dataset.fetch({"from": "2019-06"})
res = dataset.fetch({"from": "2019-06", "to": "2019-07"})
Develop
Set up:
$ pip install -r requirements.txt
Run tests:
$ make tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
uc_scraper-0.0.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for uc_scraper-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d086729243f235643c0e53ea1fc7ac42b6042b0d2a48a1d81ed97545fbeb76d1 |
|
MD5 | 19b2962be70b3b060fe653a78ee95c53 |
|
BLAKE2b-256 | 778f46f56ac951211369c8654730d2d2c28eb4988ea4976e3b6b7015892d2dfb |