Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpo-oze-0.2.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

mpo_oze-0.2.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file mpo-oze-0.2.1.tar.gz.

File metadata

  • Download URL: mpo-oze-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 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

Hashes for mpo-oze-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d70a16f4eb98f1b172ca1be2315644b2183a08313a9aa7c787e0423a8299f036
MD5 f6a5f54778c2a6abc9ecfc21d19bc535
BLAKE2b-256 52f5d7bfe3575a6015e767973713c9f77d01112e2273a0c6a5cefe6dffcd224b

See more details on using hashes here.

Provenance

File details

Details for the file mpo_oze-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mpo_oze-0.2.1-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

Hashes for mpo_oze-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 306fee37958cb4b86e36904d710a6e24a7c1b0c674cae6ae01613c5ee8506e46
MD5 65b1e59505aa3fc5c3cb376977d6bc85
BLAKE2b-256 c8513968186a2291edf51f93da52a446c0623053e27acbcd884b6f6929c5c0d6

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page