Skip to content

openclimatefix/ruvnl-consumer-app

Repository files navigation

RUVNL-consumer-app

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)

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

    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

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

About

Data consumer that scrapes/saves data from the Rajasthan Urja Vikas Nigam Limited (RUVNL) website.

Resources

License

Stars

Watchers

Forks

Packages

No packages published