python-apims 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
apims/const.py CHANGED
@@ -7,7 +7,7 @@ from typing import Final
7
7
  MYT: Final = timezone(timedelta(hours=8))
8
8
  API_URL: Final = (
9
9
  "https://eqms.doe.gov.my/api3/publicmapproxy/PUBLIC_DISPLAY/"
10
- "0f898ad95c524e4d924083f21b764b88/MapServer/0/query"
10
+ "CAQM_MCAQM_Current_Reading/MapServer/0/query"
11
11
  )
12
12
  API_PARAMS: Final = {
13
13
  "f": "json",
@@ -15,9 +15,10 @@ API_PARAMS: Final = {
15
15
  "outFields": (
16
16
  "STATION_ID,STATION_LOCATION,PLACE,STATE_NAME,REGION_NAME,"
17
17
  "STATION_CATEGORY,LATITUDE,LONGITUDE,API,PARAM_SELECTED,CLASS,DATETIME,"
18
- "PM25_CONC,PM10_CONC"
18
+ "PM25_CONC,PM10_CONC,SO2_CONC,NO2_CONC,O3_CONC,CO_CONC,"
19
+ "SI_SO2,SI_NO2,SI_O3,SI_CO,TEMPERATURE,RELATIVE_HUMIDITY"
19
20
  ),
20
21
  "returnGeometry": "false",
21
22
  }
22
- USER_AGENT: Final = "python-apims/0.1.0 (+https://github.com/zubirjamal/python-apims)"
23
+ USER_AGENT: Final = "python-apims/0.2.0 (+https://github.com/zubirjamal/python-apims)"
23
24
  REQUEST_TIMEOUT: Final = 30
apims/models.py CHANGED
@@ -27,6 +27,16 @@ class Station:
27
27
  updated: datetime | None
28
28
  pm25: float | None = None # µg/m³, current hourly concentration
29
29
  pm10: float | None = None
30
+ so2: float | None = None
31
+ no2: float | None = None
32
+ o3: float | None = None
33
+ co: float | None = None
34
+ si_so2: float | None = None
35
+ si_no2: float | None = None
36
+ si_o3: float | None = None
37
+ si_co: float | None = None
38
+ temperature: float | None = None
39
+ relative_humidity: float | None = None
30
40
 
31
41
  @property
32
42
  def mobile(self) -> bool:
@@ -50,6 +60,16 @@ class Station:
50
60
  "updated": self.updated.isoformat() if self.updated else None,
51
61
  "pm25": self.pm25,
52
62
  "pm10": self.pm10,
63
+ "so2": self.so2,
64
+ "no2": self.no2,
65
+ "o3": self.o3,
66
+ "co": self.co,
67
+ "si_so2": self.si_so2,
68
+ "si_no2": self.si_no2,
69
+ "si_o3": self.si_o3,
70
+ "si_co": self.si_co,
71
+ "temperature": self.temperature,
72
+ "relative_humidity": self.relative_humidity,
53
73
  "mobile": self.mobile,
54
74
  }
55
75
 
@@ -103,6 +123,16 @@ def parse_station_attributes(attrs: dict[str, Any]) -> Station | None:
103
123
  updated=parse_time(attrs.get("DATETIME")),
104
124
  pm25=parse_concentration(attrs.get("PM25_CONC")),
105
125
  pm10=parse_concentration(attrs.get("PM10_CONC")),
126
+ so2=parse_concentration(attrs.get("SO2_CONC")),
127
+ no2=parse_concentration(attrs.get("NO2_CONC")),
128
+ o3=parse_concentration(attrs.get("O3_CONC")),
129
+ co=parse_concentration(attrs.get("CO_CONC")),
130
+ si_so2=parse_concentration(attrs.get("SI_SO2")),
131
+ si_no2=parse_concentration(attrs.get("SI_NO2")),
132
+ si_o3=parse_concentration(attrs.get("SI_O3")),
133
+ si_co=parse_concentration(attrs.get("SI_CO")),
134
+ temperature=parse_concentration(attrs.get("TEMPERATURE")),
135
+ relative_humidity=parse_concentration(attrs.get("RELATIVE_HUMIDITY")),
106
136
  )
107
137
 
108
138
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-apims
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Asynchronous Python client for Malaysia DOE APIMS (Air Pollutant Index Management System)
5
5
  Author: Zubir Jamal
6
6
  License: MIT
@@ -37,5 +37,5 @@ pip install python-apims
37
37
 
38
38
  ## Features
39
39
  - Fetches real-time Air Pollutant Index (API / IPU) from all 68 nationwide monitoring stations in Malaysia.
40
- - Provides PM2.5 and PM10 concentrations, station locations, categories, and timestamps.
40
+ - Provides PM2.5, PM10, SO2, NO2, O3, and CO concentrations, gas sub-indices (`SI_*`), temperature, relative humidity, station locations, categories, and timestamps.
41
41
  - Spatial helpers for locating nearest air quality monitoring stations.
@@ -0,0 +1,9 @@
1
+ apims/__init__.py,sha256=1UWT1QWAcpTJ4uuG1wUKOAnDky7R6fycPdbHLaeuiWw,680
2
+ apims/client.py,sha256=r6D3qkgSskWQfyf3gStpapDUFklgqzp5yIbkDOZBfbY,2885
3
+ apims/const.py,sha256=MGW3asMLT7_q0iI9vyAO_KVEXClyPQAmoJKk4tVOs-g,830
4
+ apims/exceptions.py,sha256=JoDfOlnRdM3ccMomV91_-7tkqMUH4hccFnhVhViXuqM,261
5
+ apims/models.py,sha256=LTR8jcDImTPR60r3m3xzbPPMHSQOUav1yBwUswzPlEA,5428
6
+ python_apims-0.2.0.dist-info/METADATA,sha256=82QQsn5H2t4a_mugf0i_x7q3r_RVkzyldZ7ZBjSanZA,1722
7
+ python_apims-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
8
+ python_apims-0.2.0.dist-info/top_level.txt,sha256=8U2B1zxD_nN8DOhNTuKd4fzEfiFa3GBaWzpa4jIDRss,6
9
+ python_apims-0.2.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- apims/__init__.py,sha256=1UWT1QWAcpTJ4uuG1wUKOAnDky7R6fycPdbHLaeuiWw,680
2
- apims/client.py,sha256=r6D3qkgSskWQfyf3gStpapDUFklgqzp5yIbkDOZBfbY,2885
3
- apims/const.py,sha256=S-7TxSbFN58ZwI_RuEt5wEDMhiZ7ddzi8VjknFSW9R4,735
4
- apims/exceptions.py,sha256=JoDfOlnRdM3ccMomV91_-7tkqMUH4hccFnhVhViXuqM,261
5
- apims/models.py,sha256=cjXgFzIwEgKgPltHeWXl089Rzl1ZXFRcS1UGKYrf6n0,4168
6
- python_apims-0.1.0.dist-info/METADATA,sha256=HChv3KbPrrBCMTM9sDaG7ggiB-0rDPDG-L8rG1H_5qI,1645
7
- python_apims-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
8
- python_apims-0.1.0.dist-info/top_level.txt,sha256=8U2B1zxD_nN8DOhNTuKd4fzEfiFa3GBaWzpa4jIDRss,6
9
- python_apims-0.1.0.dist-info/RECORD,,