{"id":13686005,"url":"https://github.com/onmyway133/Scale","last_synced_at":"2025-05-01T05:31:26.262Z","repository":{"id":62455034,"uuid":"49151252","full_name":"onmyway133/Scale","owner":"onmyway133","description":":flags: Unit converter in Swift","archived":false,"fork":false,"pushed_at":"2020-04-14T07:36:54.000Z","size":501,"stargazers_count":323,"open_issues_count":1,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T15:05:52.743Z","etag":null,"topics":["converter","formatter","ios","scale","swift","unit"],"latest_commit_sha":null,"homepage":"https://onmyway133.github.io/","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/onmyway133.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":"2016-01-06T17:43:50.000Z","updated_at":"2024-03-24T04:11:31.000Z","dependencies_parsed_at":"2022-11-01T23:46:41.764Z","dependency_job_id":null,"html_url":"https://github.com/onmyway133/Scale","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onmyway133%2FScale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onmyway133%2FScale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onmyway133%2FScale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onmyway133%2FScale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onmyway133","download_url":"https://codeload.github.com/onmyway133/Scale/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251830449,"owners_count":21650802,"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":["converter","formatter","ios","scale","swift","unit"],"created_at":"2024-08-02T14:01:01.152Z","updated_at":"2025-05-01T05:31:25.723Z","avatar_url":"https://github.com/onmyway133.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Scale\n\n❤️ Support my app ❤️ \n\n- [Push Hero - pure Swift native macOS application to test push notifications](https://www.producthunt.com/posts/push-hero-2)\n- [PastePal - Pasteboard, note and shortcut manager](https://www.producthunt.com/posts/pastepal)\n- [Frame recorder - Recorder gif and video with frame](https://www.producthunt.com/posts/frame-recorder)\n- [Alias - App and file shortcut manager](https://www.producthunt.com/posts/alias-shortcut-manager)\n- [Other apps](https://onmyway133.github.io/projects/)\n\n❤️❤️😇😍🤘❤️❤️\n\nUnit converter in Swift\n\n[![CI Status](http://img.shields.io/travis/Khoa Pham/Scale.svg?style=flat)](https://travis-ci.org/Khoa Pham/Scale)\n[![Version](https://img.shields.io/cocoapods/v/Scale.svg?style=flat)](http://cocoapods.org/pods/Scale)\n[![License](https://img.shields.io/cocoapods/l/Scale.svg?style=flat)](http://cocoapods.org/pods/Scale)\n[![Platform](https://img.shields.io/cocoapods/p/Scale.svg?style=flat)](http://cocoapods.org/pods/Scale)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\u003cimg src=\"https://img.shields.io/badge/%20in-swift%203.0-orange.svg\"\u003e\n\n![](Screenshots/Banner.png)\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Features\n\n### Unit\n\n- Strongly typed unit\n- Division may throw error\n- Operation upon same type, the result is the smaller unit of the two\n\n```swift\nlet length = 5.kilometer + 7.meter  // 5007 meter\nlet weight = 10.0.kilogram * 5.gram // 50000 gram\n```\n\n- Convert to any unit of the same type\n\n```swift\n2.week.to(unit: .hour) // 336 hour\n```\n\n### Support\n\n- Angle\n```swift\nlet angle = 5.degree + 2.radian\n```\n\n- Area\n```swift\nlet area = 5.acre + 2.hectare\n```\n\n- Energy\n```swift\nlet energy = 5.joule + 2.watthour\n```\n\n- Metric\n```swift\nlet metric = 5.base + 2.kilo\n```\n\n- Volume\n```swift\nlet volume = 5.liter + 2.gallon\n```\n\n- Temperature\n```swift\nlet temperature = 5.fahrenheit + 2.celsius\n```\n\n- Time\n```swift\nlet time = 5.day + 2.hour\n```\n\n- Length\n```swift\nlet length = 5.yard + 2.meter\n```\n\n- Weight\n```swift\nlet weight = 5.kilogram + 2.pound\n```\n\n### Add more\n\n- Add new definition file with extension `.def` inside `Definitions` group\n- Run `xcrun swift Script.swift` inside `Script` group\n- Add newly generated files into `Output` group, target Scale\n- Go into `Example` and `pod install`\n\n## Notes\n\nSome unit types like `Temperature` must be converted manually\n\n## Installation\n\nScale is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"Scale\"\n```\n\n## Author\n\nKhoa Pham, onmyway133@gmail.com\n\n## License\n\nScale is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonmyway133%2FScale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonmyway133%2FScale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonmyway133%2FScale/lists"}