Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 1.47 KB

README.md

File metadata and controls

68 lines (48 loc) · 1.47 KB

CPCB CCR client

An unofficial python client to obtain data from the CPCB's CCR platform directly into your python environment.

Installation

$ pip install cpcbccr

Usage

  • 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

License

MIT License

Contributing

If you find an issue please report/file an issue here or file a pr here

Credits

Made with Python