An unofficial python client to obtain data from the CPCB's CCR platform directly into your python environment.
$ pip install cpcbccr
- Importing
>>> import cpcbccr as cpcb
- Get States
>>> states = cpcb.get_states()
- Get Cities
>>> cities = cpcb.get_cities(state='Punjab')
- Get Stations
>>> stations = cpcb.get_stations(city='Amritsar')
- Get Data
>>> data = cpcb.get_data(from_date='01-01-2020',
to_date='02-01-2020',
station_id='site_279',
criteria='24 Hours')
For more supported criteria check
doc-string.
- Save Data
>>> cpcb.save_data(path='/path/to/file.csv',
from_date='01-01-2020',
end_date = '02-01-2020',
station_id = 'site_279',
criteria = '24 Hours')
Supported Fileformats:
csv
,xlsx
,json
If you find an issue please report/file an issue here or file a pr here
Made with Python