{"id":15170607,"url":"https://github.com/workingdog/owonecall","last_synced_at":"2025-10-13T05:11:53.926Z","repository":{"id":40418274,"uuid":"276539662","full_name":"workingDog/OWOneCall","owner":"workingDog","description":"SwiftUI OpenWeather One Call API library","archived":false,"fork":false,"pushed_at":"2024-05-25T23:05:50.000Z","size":657,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-22T20:54:44.450Z","etag":null,"topics":["openweather","swift","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workingDog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T03:30:59.000Z","updated_at":"2025-03-06T05:46:58.000Z","dependencies_parsed_at":"2025-02-11T08:45:16.560Z","dependency_job_id":null,"html_url":"https://github.com/workingDog/OWOneCall","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"cfa78d07a2916c699c7c493bb272ad59e566703d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/workingDog/OWOneCall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWOneCall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWOneCall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWOneCall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWOneCall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workingDog","download_url":"https://codeload.github.com/workingDog/OWOneCall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWOneCall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013695,"owners_count":26085390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openweather","swift","swiftui"],"created_at":"2024-09-27T08:04:13.606Z","updated_at":"2025-10-13T05:11:53.912Z","avatar_url":"https://github.com/workingDog.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftUI OpenWeather One Call API library\n\n\n[One Call API 3.0](https://openweathermap.org/api/one-call-3)\n\n\"Make just one API call and get all your essential weather data for a specific location with our new OpenWeather One Call API.\"\n\n**OWOneCall** is a small Swift library to connect to the [One Call API 3.0](https://openweathermap.org/api/one-call-3) and retrieve the chosen weather data. Made easy to use with SwiftUI.\n\nProvides for current, forecast and historical weather data through a single function call.\n\n### Usage\n\nWeather data from [OpenWeather One Call API](https://openweathermap.org/api/one-call-api) is accessed through the use of a **OWProvider**, with a single function **getWeather**, eg:\n\n```swift\nlet weatherProvider = OWProvider(apiKey: \"your key\")  // default One Call API 3.0\n@State var weather = OWResponse()\n...\n\nAlternatively;\n\nlet weatherProvider = OWProvider(apiKey: \"your key\", urlString: \"https://api.openweathermap.org/data/3.0/onecall\")  \n\n\n// using a binding\nweatherProvider.getWeather(lat: 35.661991, lon: 139.762735, weather: $weather, options: OWOptions.current())\n...\nText(weather.current?.weatherInfo() ?? \"\")\n\n// or using the async style, eg with `.task {...}`\nif let results = await weatherProvider.getWeather(lat: 35.661991, lon: 139.762735, options: OWOptions.dailyForecast(lang: lang)) {\n        weather = results\n}\n\n// or using the callback style, eg with `.onAppear {...}`\nweatherProvider.getWeather(lat: 35.661991, lon: 139.762735, options: OWOptions.current()) { response in\n       if let theWeather = response {\n          self.weather = theWeather\n       }\n}\n```\n\nSee the following for example uses:\n\n-   [*OWOneCallExample*](https://github.com/workingDog/OWOneCallExample) \n\n-   [SwiftUI Weather App](https://github.com/workingDog/YAWA)\n\n\n### Options\n\nOptions available:\n\n-   see [OpenWeather One Call API](https://openweathermap.org/api/one-call-api) for all the options available.\n\nCreate an options object such as this, to retrieve the current weather data:\n\n```swift\nlet myOptions = OWOptions(excludeMode: [.daily, .hourly, .minutely], units: .metric, lang: \"en\")\n```\n\nAdditional convenience options to retrieve current and forecast weather data: \n\n-    OWOptions.current(lang: String = \"en\")\n-    OWOptions.dailyForecast(lang: String = \"en\")  \n-    OWOptions.hourlyForecast(lang: String = \"en\")\n\nAdditional convenience options to retrieve past historical weather data: \n\n-    OWHistOptions.yesterday(lang: String = \"en\")\n-    OWHistOptions.daysAgo(day: Double, lang: String = \"en\")\n\nUse the **lang** options parameter to chose the language of the results, default \"en\".\n\n\n### Installation\n\nInclude the files in the **./Sources/OWOneCall** folder into your project or preferably use **Swift Package Manager**. \n\n#### Swift Package Manager  (SPM)\n\nCreate a Package.swift file for your project and add a dependency to:\n\n```swift\ndependencies: [\n  .package(url: \"https://github.com/workingDog/OWOneCall.git\", from: \"1.3.2\")\n]\n```\n\n#### Using Xcode\n\n    Select your project \u003e Swift Packages \u003e Add Package Dependency...\n    https://github.com/workingDog/OWOneCall.git\n\nThen in your code:\n\n```swift\nimport OWOneCall\n```\n    \n### References\n\n-    [OpenWeather One Call API](https://openweathermap.org/api/one-call-api)\n\n\n### Requirement\n\nRequires a valid OpenWeather key, see:\n\n-    [OpenWeather how to start](https://openweathermap.org/appid)\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkingdog%2Fowonecall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkingdog%2Fowonecall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkingdog%2Fowonecall/lists"}