{"id":16921210,"url":"https://github.com/bdrelling/goatherb","last_synced_at":"2025-04-11T11:31:45.900Z","repository":{"id":58470902,"uuid":"528231319","full_name":"bdrelling/GoatHerb","owner":"bdrelling","description":"Cross-platform Swift library for accessing the public GitHub API.","archived":false,"fork":false,"pushed_at":"2023-03-29T18:53:23.000Z","size":98,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T13:21:36.493Z","etag":null,"topics":["github","github-api","ios","linux","macos","swift","tvos","vapor","watchos"],"latest_commit_sha":null,"homepage":"https://briandrelling.com","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/bdrelling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-24T02:08:04.000Z","updated_at":"2024-01-07T20:45:16.000Z","dependencies_parsed_at":"2023-02-09T09:31:07.785Z","dependency_job_id":null,"html_url":"https://github.com/bdrelling/GoatHerb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdrelling%2FGoatHerb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdrelling%2FGoatHerb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdrelling%2FGoatHerb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdrelling%2FGoatHerb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdrelling","download_url":"https://codeload.github.com/bdrelling/GoatHerb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248383992,"owners_count":21094651,"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":["github","github-api","ios","linux","macos","swift","tvos","vapor","watchos"],"created_at":"2024-10-13T19:50:59.986Z","updated_at":"2025-04-11T11:31:45.506Z","avatar_url":"https://github.com/bdrelling.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoatHerb\n\n[![CI Status](https://github.com/bdrelling/GoatHerb/actions/workflows/tests.yml/badge.svg)](https://github.com/bdrelling/GoatHerb/actions/workflows/tests.yml)\n![Code Coverage](https://img.shields.io/badge/coverage-98%25-success)\n[![Latest Release](https://img.shields.io/github/v/tag/bdrelling/GoatHerb?color=blue\u0026label=)](https://github.com/bdrelling/GoatHerb/tags)\n[![Swift Compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fbdrelling%2FGoatHerb%2Fbadge%3Ftype%3Dswift-versions\u0026label=)](https://swiftpackageindex.com/bdrelling/GoatHerb)\n[![Platform Compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fbdrelling%2FGoatHerb%2Fbadge%3Ftype%3Dplatforms\u0026label=)](https://swiftpackageindex.com/bdrelling/GoatHerb)\n[![License](https://img.shields.io/github/license/bdrelling/GoatHerb?label=)](https://github.com/bdrelling/GoatHerb/blob/main/LICENSE)\n\n**GoatHerb** is a cross-platform Swift library for accessing the GitHub API.\n\n## Features\n\n### General\n\n- [x] Compatible with [swift-log](https://github.com/apple/swift-log).\n- [x] Full concurrency (async/await) support.\n- [x] Cross-platform support:\n  - [x] iOS\n  - [x] macOS\n  - [x] tvOS\n  - [x] watchOS\n  - [x] Linux _(optimized for Server-side Swift)_\n\n\u003e Most cross-platform SDKs simply replace Foundation's `URLSession` with SwiftNIO's `AsyncHTTPClient` and call it a day. Not GoatHerb! GoatHerb is built on top of [KippleNetworking](https://github.com/swift-kipple/Networking), which intelligently chooses between Foundation's `URLSession` or SwiftNIO's `AsyncHTTPClient` depending on the platform, ensuring optimal networking for the platform it's running on.\n\n### GitHub API\n\n- [x] Get Rate Limit\n- [x] Get User\n- [x] Get Organization\n- [x] Get User Repositories\n- [x] Get Organization Repositories\n- [x] Get Repository\n\n\u003e That's it for now! If you're looking for a more feature-complete SDK, check out [the list of GitHub SDKs on Swift Package Index](https://swiftpackageindex.com/search?query=GitHub).\n\n## Usage\n\nCreate a `GitHub` object.\n\n```swift\nlet gitHub = GitHub()\n```\n\nYou can optionally provide an `accessToken` in the initializer, or via setting the `GITHUB_ACCESS_TOKEN` or `GITHUB_TOKEN` environment variable.\n\n```swift\nlet gitHub = GitHub(accessToken: \"\u003ctoken\u003e\")\n```\n\nFrom there, requests are extremely straight-forward. Here are some examples:\n\n```swift\n// Get a user.\nlet user = try await self.gitHub.getUser(\"bdrelling\")\n\n// Get an organization.\nlet organization = try await self.gitHub.getOrganization(\"swift-kipple\")\n\n// Get all repositories for a user.\nlet repositories = try await self.gitHub.getRepositories(user: \"bdrelling\")\n\n// Get all repositories for an organization.\nlet repositories = try await self.gitHub.getRepositories(org: \"swift-kipple\")\n```\n\n## Contributing\n\nDiscussions, issues, and pull requests are more than welcome! I'm happy to extend the functionality of this library, with respect to the features listed in the [Out of Scope](#out-of-scope) section.\n\nIf opening a pull request, please ensure that the package retains _as close to_ 100% code coverage as possible.\n\n## Credits\n\nSpecial thanks to [@boiarqin](https://github.com/boiarqin) for providing me with an unforgettable repository name.\n\n## License\n\nThis project is released under the MIT license. See [LICENSE](/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdrelling%2Fgoatherb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdrelling%2Fgoatherb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdrelling%2Fgoatherb/lists"}