An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

RUVNL-consumer-app

[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#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
Anas Khan

💻
Peter Dudfield
Peter Dudfield

💻
Chris Briggs
Chris Briggs

💻
Aditya Sawant
Aditya Sawant

💻
Suvan Banerjee
Suvan Banerjee

💻

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