{"id":16683824,"url":"https://github.com/freesuraj/bulldog","last_synced_at":"2025-06-14T15:32:24.627Z","repository":{"id":56904050,"uuid":"74179345","full_name":"freesuraj/Bulldog","owner":"freesuraj","description":"Simple yet powerful json parser for iOS and Mac","archived":false,"fork":false,"pushed_at":"2019-04-03T06:20:20.000Z","size":186,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T14:17:33.874Z","etag":null,"topics":["json","json-parser","swift","swiftyjson"],"latest_commit_sha":null,"homepage":null,"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/freesuraj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-11-19T01:26:37.000Z","updated_at":"2019-04-03T06:19:57.000Z","dependencies_parsed_at":"2022-08-21T02:50:17.464Z","dependency_job_id":null,"html_url":"https://github.com/freesuraj/Bulldog","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FBulldog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FBulldog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FBulldog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FBulldog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freesuraj","download_url":"https://codeload.github.com/freesuraj/Bulldog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248127549,"owners_count":21052245,"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":["json","json-parser","swift","swiftyjson"],"created_at":"2024-10-12T14:26:25.148Z","updated_at":"2025-04-09T23:25:02.951Z","avatar_url":"https://github.com/freesuraj.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Bulldog: Json Parser](https://raw.githubusercontent.com/freesuraj/Bulldog/master/Assets/logo.png)\n\n[![Build Status](https://travis-ci.org/freesuraj/Bulldog.svg?branch=master)](https://travis-ci.org/freesuraj/Bulldog)\n[![Coverage Status](https://coveralls.io/repos/github/freesuraj/Bulldog/badge.svg?branch=master)](https://coveralls.io/github/freesuraj/Bulldog?branch=master)\n[![codecov](https://codecov.io/gh/freesuraj/Bulldog/branch/master/graph/badge.svg)](https://codecov.io/gh/freesuraj/Bulldog)\n[![Code Climate](https://codeclimate.com/github/freesuraj/Bulldog/badges/gpa.svg)](https://codeclimate.com/github/freesuraj/Bulldog)\n[![codebeat badge](https://codebeat.co/badges/b009ba3f-092c-49df-861c-d9f2e758e9e6)](https://codebeat.co/projects/github-com-freesuraj-bulldog)\n[![Issue Count](https://codeclimate.com/github/freesuraj/Bulldog/badges/issue_count.svg)](https://codeclimate.com/github/freesuraj/Bulldog)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Bulldog.svg)](http://cocoadocs.org/docsets/Bulldog/)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Platform](https://img.shields.io/cocoapods/p/Bulldog.svg?style=flat)](http://cocoadocs.org/docsets/Bulldog)\n[![Twitter](https://img.shields.io/badge/twitter-@iosCook-blue.svg?style=flat)](http://twitter.com/iosCook)\n[![GitHub forks](https://img.shields.io/github/forks/freesuraj/bulldog.svg?style=social\u0026label=Fork)](https://github.com/freesuraj/bulldog)\n[![GitHub stars](https://img.shields.io/github/stars/freesuraj/bulldog.svg?style=social\u0026label=Star)](https://github.com/freesuraj/bulldog)\n\n# Bulldog\nBulldog is a super-fast json parser that will keep attacking until it gets the value you desire, or you give up. Just like a bulldog.\n\n## Why Bulldog?\n\n- ✅ Super-light\n- ✅ Easily extendible\n- ✅ Can easily traverse through path of a json object to get the final value while ignoring the type of intermediate objects\n- ✅ Utilises the apple's JSONSerialization underneath\n- ✅ Well tested with 100% test coverage\n\n## Example Usage\n\nLet's suppose we want to parse the following JSON object\n\n### response.json\n\n```\n{\n   \"id\":123,\n   \"first_name\":\"Conor\",\n   \"last_name\":\"McGregor\",\n   \"age\":28,\n   \"height\": 171,\n   \"weight\":70.5,\n   \"fights\":[\n      {\n         \"id\":\"UFC 205\",\n         \"opponent\":\"Eddie Alvarez\",\n         \"venue\":\"New York\",\n         \"win\":true\n      },\n      {\n         \"id\":\"UFC 202\",\n         \"opponent\":\"Nate Diaz\",\n         \"venue\":\"Las Vegas\",\n         \"win\":true\n      },\n      {\n         \"id\":\"UFC 196\",\n         \"opponent\":\"Nate Diaz\",\n         \"venue\":\"Las Vegas\",\n         \"win\":false\n      }\n   ]\n}\n```\n\n### parser.swift\n\nNow to parse the above json file,\n\n```swift\nlet json: Any = ... // Json from network\nlet bulldog = Bulldog(json: json)\nlet name = bulldog.string(\"first_name\") + \" \" + bulldog.string(\"last_name\") // Conor McGregor\n\nlet height = bulldog.int(\"height\") // 171\nlet weight = bulldog.double(\"weight\") // 70.5\n\n// Get first opponent of his fights\nlet firstOpponent = bulldog.string(\"fights\", 0, \"opponent\") // Eddie Alvarez\n// Get fights array\nlet fights = bulldog.array(\"fights\") // Returns array of fights\n\n// Return the first fight dictionary\nlet firstFight = bulldog.dictionary(\"fights\", 0) // Returns first fight dictionary\n\n// Check if first fight was a win\nlet isWin = Bulldog(json: fights[0]).boolean(\"win\") // Returns true\n\n```\n\n## Installation\n\n### Carthage\nBulldog is available through [Carthage](https://github.com/Carthage/Carthage). To install\nit, simply add the following line to your Cartfile:\n\n```ruby\ngit \"freesuraj/Bulldog\"\n```\n\n### Cocoapods\nAdd the following line to your Podfile:\n```ruby\npod 'Bulldog'\n```\n### Manual\nPerhaps the easiest way to use is to just copy the file [Bulldog.swift](https://github.com/freesuraj/Bulldog/blob/master/Source/Bulldog.swift) and put it in your project. That's it !!\n\n## Example\n\nPlease check the [BulldogTests.swift](https://github.com/freesuraj/Bulldog/blob/master/Tests/BulldogTests.swift) file for all possilbe use cases\n\n## About\n\n[![GitHub followers](https://img.shields.io/github/followers/freesuraj.svg?style=social\u0026label=Follow)](https://github.com/freesuraj)\n\nIf you found this little tool useful, I'd love to hear about it. You can also follow me on Twitter at [@iosCook](https://twitter.com/ioscook)\n\n\n## License\n\nBulldog is available under the MIT license. See the LICENSE file for more info.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesuraj%2Fbulldog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreesuraj%2Fbulldog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesuraj%2Fbulldog/lists"}