{"id":26213304,"url":"https://github.com/douglau/mag","last_synced_at":"2025-04-15T16:59:14.890Z","repository":{"id":57636007,"uuid":"220717917","full_name":"DougLau/mag","owner":"DougLau","description":"Library for physical quantities and units","archived":false,"fork":false,"pushed_at":"2024-07-13T18:07:45.000Z","size":155,"stargazers_count":8,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T08:19:14.423Z","etag":null,"topics":["measurement-units","rust","si","units"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DougLau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-09T23:42:20.000Z","updated_at":"2024-07-13T18:07:49.000Z","dependencies_parsed_at":"2022-09-26T20:21:32.195Z","dependency_job_id":null,"html_url":"https://github.com/DougLau/mag","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/DougLau%2Fmag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougLau%2Fmag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougLau%2Fmag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougLau%2Fmag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DougLau","download_url":"https://codeload.github.com/DougLau/mag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188191,"owners_count":20250457,"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":["measurement-units","rust","si","units"],"created_at":"2025-03-12T09:18:37.989Z","updated_at":"2025-03-12T09:18:38.530Z","avatar_url":"https://github.com/DougLau.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Mag] is a library for dealing with physical quantities and units.\n\nQuantities are created by multiplying scalar values by a unit type.  These units\nare named after common abbreviations:\n\n```rust\nuse mag::{length::{ft, m, mi}, time::{h, s}};\n\nlet a = 1.0 * ft;\nassert_eq!(a.to_string(), \"1 ft\");\n\nlet b = a.to::\u003cm\u003e();\nassert_eq!(b.to_string(), \"0.3048 m\");\n\nlet c = 30 * s;\nassert_eq!(c.to_string(), \"30 s\");\n\nlet d = 60.0 / s;\nassert_eq!(d.to_string(), \"60 ㎐\");\n\nlet e = 55.0 * mi / h;\nassert_eq!(e.to_string(), \"55 mi/h\");\n```\n\n## Highlights\n\n* Easy to understand and use\n* Performs conversions between units (SI, imperial)\n* Units are not discarded when creating quantities\n* Fast compile time\n* No external dependencies\n\n## Alternative\n\nIf mag doesn't fit your needs, you could try the [uom] crate, which has many\nmore features.\n\n[mag]: https://docs.rs/mag/latest/mag/\n[uom]: https://docs.rs/uom/latest/uom/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglau%2Fmag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglau%2Fmag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglau%2Fmag/lists"}