Parse reports covering renewables published by the Czech Ministry of Trade and Industry
Project description
Renewables in YYYY
The Czech Ministry of Industry and Trade (Ministerstvo průmyslu a obchodu, MPO) each year publishes a statistical report Renewable Energy Resources in YYYY in the form of a PDF file which contains statistics about renewable energy production in the country.
This package provides two commands for scraping links to these PDF reports and parsing tables in ther reports (for selected year).
One script scrapes links to these PDF reports from the website and saves them to CSV.
Another script parses selected pdf report using Camelot:
- reads data tables,
- removes spaces between numbers and
- saves tables as CSV files in the directory for the relevant year. It also saves one Excel file for the year (one worksheet per table).
Instalation
python3 -m venv venv
pip install mpo-oze
Usage
# Scrape links to csv file
mpo links
# Parse 2020 report
mpo pdf -y 2020
# Show 2019 report in a browser
mpo show -y 2019
# Parse only tables from page 5
mpo pdf -y 2020 -p 5
usage: mpo [-h] [-y YEAR] [-p PAGES] {links,pdf,show}
parse czech renewable energy pdf reports
positional arguments:
{links,pdf,show} scrape links to reports, parse report or show report
in a browser
optional arguments:
-h, --help show this help message and exit
-y YEAR, --year YEAR select report year of interest (default: 2020)
-p PAGES, --pages PAGES
select pages, e.g. 1,3-5,7-end (default: 2-end)
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file mpo-oze-0.2.0.tar.gz
.
File metadata
- Download URL: mpo-oze-0.2.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87a0b119d51201a52768d22b7a077465a00de42b56730a7957f6cbb19e34c05 |
|
MD5 | cf7fcf2b25a1fbdb68e6c370643a2644 |
|
BLAKE2b-256 | 1a5b12bd632f7022145c9988a0f6e511af02d7a5c399f166304078b721352fc2 |
Provenance
File details
Details for the file mpo_oze-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: mpo_oze-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6113c044b6ad903f0c94f5c3b1acbe7254e5c1986ca16f7612d0473c9d2b46 |
|
MD5 | affa5d479f631026a9d2e720a24ba4e5 |
|
BLAKE2b-256 | 693b8cf4437dbf81fc05bb1a57a08ff625232b1282a50a284bd39c5636cf1519 |