Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
A python warpper for retrieving Hong Kong SAR local weather from Hong Kong Observatory Open Data API. Please refer to the Official Documentation for request parameters and response details. Official API Documentation
hko.HKO(session)
Manage and perform requests
Return: hko.HKO class
Parameter | Optional (default value) | Type | Description |
---|---|---|---|
session | no | ClientSession | see aiohttp |
hko.HKO.weather(dataType, lang)
Retrieve weather data from Weather Information API
Return: dictionary
Parameter | Optional (default value) | Type | Description |
---|---|---|---|
dataType | no | string | type of data requested |
lang | yes (en) | string | language used in response |
hko.HKO.earthquake(dataType, lang)
Retrieve weather data from Earthquake Information API
Return: dictionary
Parameter | Optional (default value) | Type | Description |
---|---|---|---|
dataType | no | string | type of data requested |
lang | yes (en) | string | language used in response |
hko.HKO.openData(dataType, lang)
Retrieve weather data from Earthquake Information API
Return: dictionary
Parameter | Optional (default value) | Type | Description |
---|---|---|---|
dataType | no | string | type of data requested |
lang | yes (en) | string | language used in response |
station | - | string | refer to Official API Documentation |
year | - | string | refer to Official API Documentation |
month | - | string | refer to Official API Documentation |
day | - | string | refer to Official API Documentation |
hour | - | string | refer to Official API Documentation |
Get and print local weather forcast general situation in English
from hko import HKO, HKOError
import asyncio
from aiohttp import ClientSession
from aiohttp import ClientConnectorError
async def main():
async with ClientSession() as session:
try:
hko = HKO(session)
fnd = await hko.weather(dataType="fnd")
print(fnd["generalSituation"])
except HKOError as error:
print(error)
asyncio.run(main())
FAQs
An unofficial Python wrapper for public API of Hong Kong Observatory
We found that hko demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.