Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nondanee/kuuki-predict
https://github.com/nondanee/kuuki-predict
air-quality
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nondanee/kuuki-predict
- Owner: nondanee
- License: mit
- Created: 2019-04-17T10:25:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-17T10:27:06.000Z (over 5 years ago)
- Last Synced: 2024-01-30T13:23:29.570Z (10 months ago)
- Topics: air-quality
- Language: Python
- Homepage: https://nondanee-kuuki-predict.herokuapp.com/
- Size: 287 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Kuuki-Predict
Air Quality **FREE API** for China cities deployed on herokuPowered by Python3 & Flask & PostgreSQL
## Required Add-ons
- Heroku Postgres Hobby Dev (default addon)
- Heroku Scheduler (free but need verifying account)## Deployment
Click this button[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
Or run following lines in terminal
```
$ git clone https://github.com/nondanee/kuuki-predict.git && cd kuuki-predict
$ heroku create
$ heroku addons:create scheduler:standard
$ git push heroku master
$ heroku run python manage.py init
```
Then add command ```python manage.py runcrawler``` to scheduler dashboard
Set frequency ```hourly```, next due ```:30```(It is observed that official Silverlight publishing platform udpate its data around :28)
## Limitation
Limit 10k records for databaseBut increasing 361 (every city data calculated by station data) records per hour
We only save last 24 hours data
## All APIs
1. List for available cities```
GET /aqi/cities
```
2. Latest rank by aqi values *(Add '?reverse=1' for reverse order)*```
GET /aqi/rank
```
3. Latest detail for specified cities *(Split cities by ',' and no duplication)*```
GET /aqi/latest?cities=110000,510100
```
4. Last 1 to 12 hours detail for a certain city```
GET /aqi/last4h?city=110000
```## Reference
- [hebingchang/air-in-china](https://github.com/hebingchang/air-in-china)
- [ernw/python-wcfbin](https://github.com/ernw/python-wcfbin)## License
This project is under [the MIT License](https://mit-license.org/).