Python library for scraping daily electricity prices from OTE (ote-cr.cz)
Project description
python-ote
Electricity prices scraper for OTE (ote-cr.cz)
Install
pip install python-ote
Usage
from ote import Ote
from dateutil import parser
# Create client
ote = Ote()
Use getDayMarketPrices(date_from, date_to)
method to get electricity prices
for the given time range. It accepts a date_from
and optionally a date_to
,
both of which have to be a datetime.date
object. If date_to
is not specified the method returns data to today.
# Get water consumption data from the specified date to now
date_from = parser.parse('2020-08-01').date()
data = ote.getDayMarketPrices(date_from);
# Get water consumption data for a date interval
date_from = parser.parse('2020-08-01').date()
date_to = parser.parse('2020-08-11').date()
data = ote.getDayMarketPrices(date_from, date_to);
# Get water consumption data for a specific date (just 1 day)
date = parser.parse('2020-08-01').date()
data = ote.getDayMarketPrices(date, date);
Keep in mind the library is using Scrapy internally which means it is scraping the OTE website. If OTE comes to think you are abusing the website they may block your IP address and/or account.
License
See LICENSE.
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
python-ote-0.0.2.tar.gz
(5.7 kB
view hashes)
Built Distribution
python_ote-0.0.2-py3-none-any.whl
(10.7 kB
view hashes)
Close
Hashes for python_ote-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 321fed2ee6e99e3ca22ad950a030a424a74b078e0a0439cedfd09ed8b5c28443 |
|
MD5 | 9b39004e13427282e68d6ca340fb9176 |
|
BLAKE2b-256 | 1162850afe5e1e797fadb37fabf1d450b9e4887fa3d1a878b26875d228d690d5 |