{"id":17214938,"url":"https://github.com/pvoznyuk/short-numbers","last_synced_at":"2025-06-18T16:37:26.314Z","repository":{"id":57466899,"uuid":"112026118","full_name":"pvoznyuk/short-numbers","owner":"pvoznyuk","description":"Convert numbers like 23700 to 23.7k and parse converted strings back to numbers","archived":false,"fork":false,"pushed_at":"2018-08-07T17:12:50.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T02:03:02.769Z","etag":null,"topics":["formatting","numbers","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/pvoznyuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-25T18:37:18.000Z","updated_at":"2025-05-24T15:40:43.000Z","dependencies_parsed_at":"2022-09-10T02:01:04.895Z","dependency_job_id":null,"html_url":"https://github.com/pvoznyuk/short-numbers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pvoznyuk/short-numbers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvoznyuk%2Fshort-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvoznyuk%2Fshort-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvoznyuk%2Fshort-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvoznyuk%2Fshort-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvoznyuk","download_url":"https://codeload.github.com/pvoznyuk/short-numbers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvoznyuk%2Fshort-numbers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260590398,"owners_count":23033049,"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":["formatting","numbers","python"],"created_at":"2024-10-15T03:22:38.160Z","updated_at":"2025-06-18T16:37:21.237Z","avatar_url":"https://github.com/pvoznyuk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Short numbers\n\nA Python package to display big numbers in a short format and vice-versa: parse short format and return an origin value. \n\ne.g. it can format number `25300` as `25.3k` and convert `25.3k` back to `25300`\n\n## Installation\n\n```bash\npip install shortnumbers\n```\n\n## Usage\n\n### Format numbers in short format \n\n```python\nfrom shortnumbers import millify\n\nmillify(1000); # -\u003e '1k'\nmillify(5678000); # -\u003e '6M'\nmillify(-2000); # -\u003e '-2k'\nmillify(-30000000000.12); # -\u003e '-30B'\nmillify(12345, precision=2); # -\u003e '12.35k'\nmillify(12345, precision=2, suffix=\" \", ending=\"B\"); # -\u003e '12.35 kB'\nmillify(12345, precision=2, prefix=\"$\"); # -\u003e '$12.35k'\n```\n\n### Parse short format as an origina value\n\n```python\nfrom shortnumbers import parse_millify\n\nparse_millify(\"0\"); # -\u003e 0.0\nparse_millify(\"1\"); # -\u003e 1.0\nparse_millify(\"1k\"); # -\u003e 1000.0\nparse_millify(\"-1.56k\"); # -\u003e -1560.0\nparse_millify(\"24.5MB\"); # -\u003e 24500000.0\nparse_millify(\"24.5B\"); # -\u003e 24500000000.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvoznyuk%2Fshort-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvoznyuk%2Fshort-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvoznyuk%2Fshort-numbers/lists"}