{"id":19110080,"url":"https://github.com/hkellaway/purse","last_synced_at":"2025-09-12T10:35:49.727Z","repository":{"id":77939365,"uuid":"130926669","full_name":"hkellaway/Purse","owner":"hkellaway","description":"A fashionable accessory to persist data to disk :handbag:","archived":false,"fork":false,"pushed_at":"2018-10-10T23:24:35.000Z","size":68,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-01-03T03:45:30.899Z","etag":null,"topics":["ios","persistence","swift"],"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/hkellaway.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-04-24T23:57:27.000Z","updated_at":"2021-03-27T12:39:37.000Z","dependencies_parsed_at":"2023-03-03T16:15:32.025Z","dependency_job_id":null,"html_url":"https://github.com/hkellaway/Purse","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/hkellaway%2FPurse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkellaway%2FPurse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkellaway%2FPurse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkellaway%2FPurse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hkellaway","download_url":"https://codeload.github.com/hkellaway/Purse/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240163810,"owners_count":19758071,"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":["ios","persistence","swift"],"created_at":"2024-11-09T04:23:32.572Z","updated_at":"2025-02-22T11:18:37.575Z","avatar_url":"https://github.com/hkellaway.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purse :handbag:\n\nA fashionable accessory to persist data to disk.\n\n## Features \n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![Build Status](https://travis-ci.org/hkellaway/Purse.svg?branch=develop)](https://travis-ci.org/hkellaway/Purse)\n\n:lipstick: Persisting `Codable` objects to disk\u003cbr /\u003e\n:lipstick: Retrieving `Codable` objects from disk\n\n## Getting Started\n\n[Download Purse](https://github.com/hkellaway/Purse/archive/master.zip) and perform a `pod install` on the included `Demo` app to see Purse in action\n\n### Swift Version\n\nPurse is currently compatible with Swift 4.0.\n\n### Installation with CocoaPods\n\n```ruby\npod 'Purse', '0.1.0'\n```\n\n### Installation with Carthage\n\n```\ngithub \"hkellaway/Purse\"\n```\n\n## Usage\n\n### Codable\n\nLet's say we have the following `Codable` model:\n\n``` swift\nstruct Test: Codable {\n    let id: Int\n    let name: String\n}\n```\n\nWe can persist the model to the `/tmp` directory on disk by calling the following:\n\n``` swift\nlet test1 = Test(id: 1, name: \"Test 1\")\ntry Purse.shared.persist(test1, to: .temporary, fileName: \"test1.json\")\n```\n\nSimilarly, we could retrieve the model from disk by calling:\n\n```swift\nlet test1 = try Purse.shared.retrieve(from: .temporary, fileName: \"test1.json\", as: Test.self)\n```\n\n## Advanced\n\n### Persisting in Other Formats But JSON\n\nWhen persisting `Codable` objets to disk, Purse uses JSON as the format by default. If your data is in a different format that can be transformed to `Data`, you can create your own object that conforms to `DataConverter` then parameterize Purse with it:\n\n```swift\nPurse.shared.dataConverter = MyDataConverter()\n```\n\n## Credits\n\nPurse was created by [Harlan Kellaway](http://harlankellaway.com).\n\n## License\n\nPurse is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/hkellaway/Purse/master/LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkellaway%2Fpurse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkellaway%2Fpurse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkellaway%2Fpurse/lists"}