-
-
Notifications
You must be signed in to change notification settings - Fork 21
Fetch india generation data #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
solar_consumer/app.py
Outdated
| country: str = "uk", | ||
| historic_or_forecast: str = "generation", | ||
| ): | ||
| def app(db_url: str, save_method: str, csv_dir: str = None, country: str = "uk"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have you rolled back this change?
solar_consumer/data/fetch_in_data.py
Outdated
| if historic_or_forecast != "generation": | ||
| raise NotImplementedError("Only 'generation' mode is supported for India UPSLDC.") | ||
|
|
||
| # Setup headless browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you not use selenimum here
For example you can use requests, for example
import requests
from bs4 import BeautifulSoup
URL = "https://realpython.github.io/fake-jobs/"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solar data is is introduced after the initial HTML is loaded. i tried using BeautifulSoup here but it wont work as the UPSLDC page loads data using JavaScript, which requests and BeautifulSoup arent able to load.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YOu might have to fiddle with portlet_time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
page = requests.get(url)
text = page.json(), or something liek that
…climatefix/solar-consumer into Fetch-India-Generation-Data
| import pandas as pd | ||
| from datetime import datetime | ||
|
|
||
| def fetch_in_data(historic_or_forecast="generation"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add test for this
Description
The update will add the option to fetch generation data from one of the states of India (Uttar Pradesh). This data is publicly available and the current data being fetched is live solar generation data.
How Has This Been Tested?
Ran this programme locally
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: