{"id":1136,"url":"https://github.com/thoughtbot/Argo","last_synced_at":"2025-08-06T13:32:16.272Z","repository":{"id":21050537,"uuid":"24349480","full_name":"thoughtbot/Argo","owner":"thoughtbot","description":"Functional JSON parsing library for Swift","archived":false,"fork":false,"pushed_at":"2021-09-24T16:03:36.000Z","size":1264,"stargazers_count":3489,"open_issues_count":14,"forks_count":198,"subscribers_count":96,"default_branch":"main","last_synced_at":"2024-10-24T09:18:03.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thoughtbot.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/thoughtbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-22T23:37:03.000Z","updated_at":"2024-09-27T02:09:52.000Z","dependencies_parsed_at":"2022-08-05T11:00:43.479Z","dependency_job_id":null,"html_url":"https://github.com/thoughtbot/Argo","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FArgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FArgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FArgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FArgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtbot","download_url":"https://codeload.github.com/thoughtbot/Argo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226687059,"owners_count":17666929,"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-01-05T20:15:39.671Z","updated_at":"2024-12-09T14:30:47.232Z","avatar_url":"https://github.com/thoughtbot.png","language":"Swift","readme":"\u003cimg src=\"https://raw.githubusercontent.com/thoughtbot/Argo/master/web/Logo.png\" width=\"250\" /\u003e\n\n# Argo [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)\n\nArgo is a library that lets you extract models from JSON or similar structures in\na way that's concise, type-safe, and easy to extend. Using Argo, you won't need\nto write validation code to ensure that incoming data is of the right type, or\nto make sure required data fields aren't turning up empty. Argo uses Swift's\nexpressive type system to do that for you, and reports back explicit failure\nstates in case it doesn't find what you've told it to expect.\n\n_Argo_ is the Greek word for _swift_ and the name of the ship used by Jason, son\nof Aeson, of the Argonauts. Aeson is the JSON parsing library in Haskell that\ninspired Argo, much like Aeson inspired his son Jason.\n\n## Version Compatibility\n\nNote that we're aggressive about pushing `master` forward along with new\nversions of Swift. Therefore, we highly recommend against pointing at `master`,\nand instead using [one of the releases we've provided][releases].\n\nHere is the current Swift compatibility breakdown:\n\n| Swift Version | Argo Version |\n| ------------- | ------------ |\n| 4.X           | master       |\n| 3.X           | 4.X          |\n| 2.2, 2.3      | 3.X          |\n| 2.0, 2.1      | 2.X          |\n| 1.2 - 2.0     | 1.X          |\n| 1.1           | 0.3.X        |\n\n[releases]: https://github.com/thoughtbot/Argo/releases\n\n## Installation\n\n### [Carthage]\n\n[Carthage]: https://github.com/Carthage/Carthage\n\nAdd the following to your Cartfile:\n\n```\ngithub \"thoughtbot/Argo\"\n```\n\nThen run `carthage update`.\n\nFollow the current instructions in [Carthage's README][carthage-installation]\nfor up to date installation instructions.\n\nNote that if you are using newer versions of Argo, you will need to link both\n`Argo.framework` and `Runes.framework` into your app.\n\n[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application\n\n### [CocoaPods]\n\n[CocoaPods]: http://cocoapods.org\n\nAdd the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html):\n\n```ruby\npod 'Argo'\n```\n\nYou will also need to make sure you're opting into using frameworks:\n\n```ruby\nuse_frameworks!\n```\n\nThen run `pod install` with CocoaPods 0.36 or newer.\n\n### Git Submodules\n\nI guess you could do it this way if that's your thing.\n\nAdd this repo as a submodule, and add the project file to your workspace. You\ncan then link against `Argo.framework` for your application target.\n\nYou will need to do the same for [Runes] if you are using newer versions of\nArgo.\n\n[Runes]: https://github.com/thoughtbot/Runes\n\n## Usage tl;dr:\n\nPlease note: the example below requires an additional, external module named\n[Curry](https://github.com/thoughtbot/Curry) which lets us use the `curry`\nfunction to curry `User.init`.\n\nIt also imports [Runes], which is a dependency of Argo in newer versions. If\nyou are using an older version of Argo, you might not need that import.\n\n```swift\nimport Argo\nimport Curry\nimport Runes\n\nstruct User {\n  let id: Int\n  let name: String\n  let email: String?\n  let role: Role\n  let companyName: String\n  let friends: [User]\n}\n\nextension User: Decodable {\n  static func decode(_ json: JSON) -\u003e Decoded\u003cUser\u003e {\n    return curry(User.init)\n      \u003c^\u003e json \u003c| \"id\"\n      \u003c*\u003e json \u003c| \"name\"\n      \u003c*\u003e json \u003c|? \"email\" // Use ? for parsing optional values\n      \u003c*\u003e json \u003c| \"role\" // Custom types that also conform to Decodable just work\n      \u003c*\u003e json \u003c| [\"company\", \"name\"] // Parse nested objects\n      \u003c*\u003e json \u003c|| \"friends\" // parse arrays of objects\n  }\n}\n\n// Wherever you receive JSON data:\n\nlet json: Any? = try? NSJSONSerialization.JSONObjectWithData(data, options: [])\n\nif let j: Any = json {\n  let user: User? = decode(j)\n}\n```\n\nFor more information, see the [Documentation](Documentation/)\n\n## Contributing\n\nSee the [CONTRIBUTING] document. Thank you, [contributors]!\n\n[CONTRIBUTING]: CONTRIBUTING.md\n[contributors]: https://github.com/thoughtbot/Argo/graphs/contributors\n\n## License\n\nArgo is Copyright (c) 2015 thoughtbot, inc. It is free software, and may be\nredistributed under the terms specified in the [LICENSE] file.\n\n[LICENSE]: /LICENSE\n\n## About\n\n![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg)\n\nArgo is maintained and funded by thoughtbot, inc. The names and logos for\nthoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software! See [our other projects][community] or look at\nour product [case studies] and [hire us][hire] to help build your iOS app.\n\n[community]: https://thoughtbot.com/community?utm_source=github\n[case studies]: https://thoughtbot.com/work?utm_source=github\n[hire]: https://thoughtbot.com/hire-us?utm_source=github\n\n","funding_links":[],"categories":["Functional Programming","Libs","Libraries","Swift","HarmonyOS","Parsing","JSON/XML Manipulation","Parser","Data Management [🔝](#readme)","etc"],"sub_categories":["Getting Started","Data Management","[Swift](https://developer.apple.com/swift)","Other free courses","Windows Manager","Linter"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2FArgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtbot%2FArgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2FArgo/lists"}