{"id":35357837,"url":"https://github.com/rly0nheart/humanly","last_synced_at":"2026-01-27T10:18:30.979Z","repository":{"id":331326134,"uuid":"1126179845","full_name":"rly0nheart/humanly","owner":"rly0nheart","description":"A pure Rust crate to convert numbers, sizes, durations, times, and percentages into human-readable formats","archived":false,"fork":false,"pushed_at":"2026-01-01T21:55:51.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-06T08:06:12.850Z","etag":null,"topics":["human-readable","humanise","humanize"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/rly0nheart.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-01T10:13:38.000Z","updated_at":"2026-01-03T14:32:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rly0nheart/humanly","commit_stats":null,"previous_names":["rly0nheart/humanly"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rly0nheart/humanly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rly0nheart%2Fhumanly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rly0nheart%2Fhumanly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rly0nheart%2Fhumanly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rly0nheart%2Fhumanly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rly0nheart","download_url":"https://codeload.github.com/rly0nheart/humanly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rly0nheart%2Fhumanly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28397826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["human-readable","humanise","humanize"],"created_at":"2026-01-01T23:34:16.493Z","updated_at":"2026-01-13T19:13:28.395Z","avatar_url":"https://github.com/rly0nheart.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Humanly\n\nA pure Rust crate to convert numbers, sizes, durations, times, and percentages\ninto human-readable formats.\n\n## Crate Modules\n\n- `HumanNumber` — Convert numbers to K/M/B/T notation (concise) or word format (full).\n- `HumanSize` — Convert bytes to human-readable units (KiB, MiB…).\n- `HumanDuration` — Show how long ago a timestamp occurred in short or long format.\n- `HumanTime` — Convert `Duration` into H:M:S strings.\n- `HumanPercent` — Round floats and display as percentage string.\n\n## Output Formats\n\nEach type provides `.concise()` and `.full()` methods for different output styles:\n\n```rust\nuse humanly::HumanNumber;\n\n// Concise: \"1.8k\"\nprintln!(\"{}\", HumanNumber::from(1_800).concise());\n\n// Full: \"1.8 thousand\"\nprintln!(\"{}\", HumanNumber::from(1_800).full());\n```\n\n## Examples\n\n```rust\nuse humanly::{HumanNumber, HumanSize, HumanDuration, HumanTime, HumanPercent};\nuse std::time::{Duration, SystemTime};\n\n// HumanNumber\nassert_eq!(HumanNumber::from(1_200).concise(), \"1.2k\");\nassert_eq!(HumanNumber::from(1_200).full(), \"1.2 thousand\");\nassert_eq!(HumanNumber::from(1_800_000).concise(), \"1.8M\");\nassert_eq!(HumanNumber::from(1_800_000).full(), \"1.8 million\");\nassert_eq!(HumanNumber::from(2_500_000_000.0).concise(), \"2.5B\");\nassert_eq!(HumanNumber::from(2_500_000_000.0).full(), \"2.5 billion\");\nassert_eq!(HumanNumber::from(3_700_000_000_000.0).concise(), \"3.7T\");\nassert_eq!(HumanNumber::from(3_700_000_000_000.0).full(), \"3.7 trillion\");\n\n// HumanSize\n// Binary (default, 1024-based)\nassert_eq!(HumanSize::from(5_242_880).concise(), \"5 MiB\");\nassert_eq!(HumanSize::from(5_242_880).full(), \"5 mebibytes\");\n\n// Decimal (SI, 1000-based)\nlet human_size = HumanSize::from(5_000_000);\nassert_eq!(human_size.decimal().concise(), \"5 MB\");\nassert_eq!(human_size.decimal().full(), \"5 megabytes\");\n\n// HumanDuration\nlet now = SystemTime::now();\nlet result = HumanDuration::from(Some(now - Duration::from_secs(75))).concise();\nassert!(result.contains(\"1m\"));\n\n// HumanTime\nassert_eq!(HumanTime::from(Duration::from_secs(3661)).concise(), \"1h 1m 1s\");\nassert_eq!(HumanTime::from(Duration::from_secs(3661)).to_string(), \"1 hour 1 minute 1 second\");\n\n// HumanPercent\nassert_eq!(HumanPercent::from(12.3456, 1).concise(), \"12.3%\");\nassert_eq!(HumanPercent::from(12.3456, 1).to_string(), \"12.3 percent\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frly0nheart%2Fhumanly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frly0nheart%2Fhumanly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frly0nheart%2Fhumanly/lists"}