![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A simple Python wrapper for Apple's WeatherKit REST API.
You need an Apple developer account to use this library and you should first follow the setup instructions in their documentation.
It has a simple interface for retrieving a raw dictionary of weather data from the API, and a method for retrieving simplified daily forecasts as Pythonic objects. Pull requests are welcome!
pip install pyweatherkit
from weatherkit.client import WKClient
client = WKClient("YOUR TEAM ID", "YOUR SERVICE ID", "YOUR KEY ID", "PATH TO YOUR PRIVATE KEY FILE")
forecast = client.get_simple_forecast(latitude, longitude)
for day in forecast:
print(f"{day.day_of_week}: {day.daytime_icon} with a high of {round(day.temperature_high)} and a low of {round(day.temperature_low)}")
Assuming you input all of the correct client authentication parameters and a valid latitude and longitude, this should result in something like:
Thursday: 🌤️ with a high of 38 and a low of 23
Friday: 🌧️ with a high of 45 and a low of 22
Saturday: 🌧️ with a high of 67 and a low of 40
...
from weatherkit.client import WKClient
client = WKClient("YOUR TEAM ID", "YOUR SERVICE ID", "YOUR KEY ID", "PATH TO YOUR PRIVATE KEY FILE")
res = client.get_weather(44.50572, -73.24026)
You can also specify the language of the response, the timezone, and the specific datasets you need.
Only available from dates after 08/01/2021 (as of 2023-03-23)
from weatherkit.client import WKClient
from datetime import datetime
# Set dates
dailyStart = datetime.strptime("2022-11-29", "%Y-%m-%d")
dailyEnd = datetime.strptime("2022-11-30", "%Y-%m-%d")
currentAsOf = datetime.strptime("2022-11-29", "%Y-%m-%d")
client = WKClient("YOUR TEAM ID", "YOUR SERVICE ID", "YOUR KEY ID", "PATH TO YOUR PRIVATE KEY FILE")
res = client.get_weather(44.50572, -73.24026, dailyStart=dailyStart, dailyEnd=dailyEnd, currentAsOf=currentAsOf)
Try running simple_test.py from the same directory as this package.
python3 simple_test.py your_team_id your_service_id your_key_id your_key_path your_latitude your_longitude
FAQs
A Python wrapper for the WeatherKit API
We found that PyWeatherKit 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.