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
Deploy to pypi (assuming you have Twine installed, if not pip install twine)
$ 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uc_scraper-0.2.tar.gz.
File metadata
- Download URL: uc_scraper-0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62fb128c3febdc738b93830b48e12c7d8bf7cc65623cdb7ae672f0560731c452
|
|
| MD5 |
ad4477ff7e2b197ea7f4f00a6914b124
|
|
| BLAKE2b-256 |
0e46196ca25cd4fb7f487f72ba9205fe77b49ccc0aa8c23be56dbd86d94723d8
|
File details
Details for the file uc_scraper-0.2-py3-none-any.whl.
File metadata
- Download URL: uc_scraper-0.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
976cff3e6fc4dac8fd3a778029b9fb5055074d0bf84688b9f4ada368c4441c04
|
|
| MD5 |
7cae920cdf4b302b92f130e7c9358549
|
|
| BLAKE2b-256 |
29a4501e2c9f9caa887fb10d936d23c8c2033fa5ae97c43df2af78e4f66f0efb
|