{"id":18890404,"url":"https://github.com/workingdog/owmcall","last_synced_at":"2025-06-28T23:36:53.191Z","repository":{"id":151934749,"uuid":"543883290","full_name":"workingDog/OWMCall","owner":"workingDog","description":"SwiftUI OpenWeather Current Weather Data API library","archived":false,"fork":false,"pushed_at":"2024-05-28T04:34:10.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T06:13:09.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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}},"created_at":"2022-10-01T04:06:52.000Z","updated_at":"2024-05-28T04:34:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4187c38-0315-4c3d-8801-7fa0c1c99a07","html_url":"https://github.com/workingDog/OWMCall","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWMCall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWMCall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWMCall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workingDog%2FOWMCall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workingDog","download_url":"https://codeload.github.com/workingDog/OWMCall/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239861688,"owners_count":19709266,"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","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":[],"created_at":"2024-11-08T07:55:27.255Z","updated_at":"2025-02-20T15:27:13.449Z","avatar_url":"https://github.com/workingDog.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift OpenWeather Current Weather Data API library\n\n**OWMCall** is a small Swift library to connect to the [OpenWeather Current Weather Data API](https://openweathermap.org/api#current) and retrieve the chosen weather data. Made easy to use with **SwiftUI**.\n\nThe library provides for **current** data through a single function call.\n\n### Usage\n\nWeather data from [OpenWeather Current Weather Data API](https://openweathermap.org/api#current) is accessed through the use of a **OWMProvider**, with a single function **getWeather**, eg:\n\n```swift\nlet weatherProvider = OWMProvider(apiKey: \"your key\") // default Current Weather API 2.5\n@State var weather = OWMResponse()\n...\n\nAlternatively;\n\nlet weatherProvider = OWMProvider(apiKey: \"your key\", urlString: \"https://api.openweathermap.org/data/2.5/weather\")  \n\n\n// using a binding\nweatherProvider.getWeather(lat: 35.661991, lon: 139.762735, weather: $weather)\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) {\n        weather = results\n}\n\n// or using the callback style, eg with `.onAppear {...}`\nweatherProvider.getWeather(lat: 35.661991, lon: 139.762735) { response in\n       if let theWeather = response {\n          self.weather = theWeather\n       }\n}\n```\n\nSee the following for example uses:\n\n-   [*OWMCallExample*](https://github.com/workingDog/OWMCallExample)\n\n\n### Options\n\nOptions available:\n\n-   see [OpenWeather Current Weather Data API](https://openweathermap.org/current) for all the options available.\n\nDefault options in the `getWeather(...)` call, is metric with the current local language.\n\nCreate a custom options object such as this, to retrieve the current weather data:\n\n```swift\nlet myOptions = OWMOptions(units: .metric, lang: \"en\")\n\nweatherProvider.getWeather(lat: 35.661991, lon: 139.762735, weather: $weather, options: myOptions)\n```\n\n### Installation\n\nInclude the files in the **./Sources/OWMCall** 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/OWMCall.git\", from: \"1.0.0\")\n]\n```\n\n#### Using Xcode\n\n    Select your project \u003e Swift Packages \u003e Add Package Dependency...\n    https://github.com/workingDog/OWMCall.git\n\nThen in your code:\n\n```swift\nimport OWMCall\n```\n    \n### References\n\n-    [OpenWeather Current Weather Data API](https://openweathermap.org/api#current)\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%2Fowmcall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkingdog%2Fowmcall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkingdog%2Fowmcall/lists"}