https://github.com/openclimatefix/ruvnl-consumer-app
Data consumer that scrapes/saves data from the Rajasthan Urja Vikas Nigam Limited (RUVNL) website.
https://github.com/openclimatefix/ruvnl-consumer-app
Last synced: 4 months ago
JSON representation
Data consumer that scrapes/saves data from the Rajasthan Urja Vikas Nigam Limited (RUVNL) website.
- Host: GitHub
- URL: https://github.com/openclimatefix/ruvnl-consumer-app
- Owner: openclimatefix
- License: mit
- Created: 2024-01-25T15:56:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T11:15:35.000Z (over 1 year ago)
- Last Synced: 2025-01-20T23:58:34.883Z (over 1 year ago)
- Language: Python
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RUVNL-consumer-app
[](#contributors-)
This consumer pulls data from the Rajasthan Urja Vikas Nigam Limited (RUVNL) website.
The API used is `http://sldc.rajasthan.gov.in/rrvpnl/read-sftp?type=overview`
## Install dependencies (requires [poetry](https://python-poetry.org/))
```
poetry install
```
## Linting and formatting
Lint with:
```
make lint
```
Format code with:
```
make format
```
## Running tests
```
make test
```
## Running the app locally
Replace `{DB_URL}` with a postgres DB connection string (see below for setting up a ephemeral local DB)
If testing on a local DB, you may use the following script to seed the the DB with a dummy user, site and site_group.
```
DB_URL={DB_URL} poetry run seeder
```
⚠️ Note this is a destructive script and will drop all tables before recreating them to ensure a clean slate. DO NOT RUN IN PRODUCTION ENVIRONMENTS
This example invokes app.py and passes the help flag
```
DB_URL={DB_URL} poetry run app --help
```
### Starting a local database using docker
```bash
docker run \
-it --rm \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-p 54545:5432 postgres:14-alpine \
postgres
```
The corresponding `DB_URL` will be
`postgresql://postgres:postgres@localhost:54545/postgres`
## Building and running in [Docker](https://www.docker.com/)
Build the Docker image
```
make docker.build
```
Run the image (this example invokes app.py and passes the help flag)
```
docker run -it --rm ocf/ruvnl-consumer-app --help
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Anas Khan
💻

Peter Dudfield
💻

Chris Briggs
💻

Aditya Sawant
💻

Suvan Banerjee
💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!