Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/aqiutils
Swift class to convert pollutant concentration values to AQI
https://github.com/hrbrmstr/aqiutils
aqi pm10 pm25 swift
Last synced: about 2 months ago
JSON representation
Swift class to convert pollutant concentration values to AQI
- Host: GitHub
- URL: https://github.com/hrbrmstr/aqiutils
- Owner: hrbrmstr
- License: mit
- Created: 2020-10-18T15:32:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-18T15:36:32.000Z (about 4 years ago)
- Last Synced: 2023-12-16T14:39:19.511Z (about 1 year ago)
- Topics: aqi, pm10, pm25, swift
- Language: Swift
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AQIUtils
Swift class to convert pollutant concentration values to AQI
## Examples
```swift
debugPrint("concentration: 15.70 => \(AQIUtils.pm10_aqi(concentration: 15.70))")
// "concentration: 15.70 => AQIResult(aqi: 15, category: Good, pollutant: PM10)"
``````swift
debugPrint("concentration: 13.36 => \(AQIUtils.pm2p5_aqi(concentration: 13.36))")
// "concentration: 13.36 => AQIResult(aqi: 54, category: Moderate, pollutant: PM2.5)"
``````swift
debugPrint("concentration: 31.20 => \(AQIUtils.co_aqi(concentration: 31.2))")
// "concentration: 31.20 => AQIResult(aqi: 308, category: Hazardous, pollutant: Carbon Monoxide)"
``````swift
debugPrint("concentration: 0.15 => \(AQIUtils.so2_aqi(concentration: 0.15))")
// "concentration: 0.15 => AQIResult(aqi: 135, category: Unhealthy for Sensitive Groups, pollutant: Sulfur Dioxide)"
```