{"id":41386514,"url":"https://github.com/pykit3/k3num","last_synced_at":"2026-01-23T11:58:47.237Z","repository":{"id":39612734,"uuid":"266985142","full_name":"pykit3/k3num","owner":"pykit3","description":"Convert number to human readable format in a string.","archived":false,"fork":false,"pushed_at":"2025-08-28T12:37:43.000Z","size":48,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T02:59:19.592Z","etag":null,"topics":["digit","human","integer","number","readable"],"latest_commit_sha":null,"homepage":"https://blog.openacid.com","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/pykit3.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":"2020-05-26T08:19:55.000Z","updated_at":"2025-08-28T12:37:47.000Z","dependencies_parsed_at":"2026-01-08T12:09:08.664Z","dependency_job_id":null,"html_url":"https://github.com/pykit3/k3num","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/pykit3/k3num","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pykit3%2Fk3num","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pykit3%2Fk3num/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pykit3%2Fk3num/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pykit3%2Fk3num/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pykit3","download_url":"https://codeload.github.com/pykit3/k3num/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pykit3%2Fk3num/sbom","scorecard":{"id":751509,"data":{"date":"2025-08-11","repo":{"name":"github.com/pykit3/k3num","commit":"5bd36634f5f5e7fa665d7dd16cb6fd736066dd37"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:95: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/pykit3/k3num/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:33","Warn: npmCommand not pinned by hash: .github/workflows/python-package.yml:36","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:77","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:78","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:79","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:83","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:104","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:105","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:106","Warn: pipCommand not pinned by hash: .github/workflows/python-package.yml:107","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:34","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 pipCommand dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2019-217 / GHSA-462w-v97r-4m45","Warn: Project is vulnerable to: PYSEC-2014-8 / GHSA-8r7q-cvjq-x353","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2014-82 / GHSA-fqh9-2qgg-h84h","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: PYSEC-2019-220 / GHSA-hj2j-77xm-mc5v","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T20:31:06.948Z","repository_id":39612734,"created_at":"2025-08-22T20:31:06.948Z","updated_at":"2025-08-22T20:31:06.948Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["digit","human","integer","number","readable"],"created_at":"2026-01-23T11:58:45.814Z","updated_at":"2026-01-23T11:58:47.229Z","avatar_url":"https://github.com/pykit3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k3num\n\n[![Build Status](https://github.com/pykit3/k3num/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3num/actions/workflows/python-package.yml)\n[![Documentation Status](https://readthedocs.org/projects/k3num/badge/?version=stable)](https://k3num.readthedocs.io/en/stable/?badge=stable)\n[![Package](https://img.shields.io/pypi/pyversions/k3num)](https://pypi.org/project/k3num)\n\nConvert number to human readable format in a string.\n\nk3num is a component of [pykit3] project: a python3 toolkit set.\n\n\nk3num convert numbers(or numbers in `dict` or `list`) to human readable\nformat in string::\n\n    \u003e\u003e\u003e readable(103425)\n    '101.0K'\n    \u003e\u003e\u003e readable({ 'total': 10240, 'progress': [1, 1024*2.1, 1024*3.2], })\n    {'total': '10K', 'progress': ['1', '2.10K', '3.20K']}\n    \u003e\u003e\u003e parsenum('5.2K')\n    5324.8\n    \u003e\u003e\u003e parsenum('10%')\n    0.1\n\nAttributes:\n    value_to_unit(dict): map of int to unit, e.g.: `1024 -\u003e \"K\"`, `1024² -\u003e \"M\"`.\n\n        Usage::\n\n            \u003e\u003e\u003e value_to_unit[1024**2]\n            'M'\n\n            \u003e\u003e\u003e unit_to_value['K']\n            1024\n\n    unit_to_value(dict): reverse map of `value_to_unit`.\n\n\nk3num.Hex provides hex integer with arithmatic support.\n\nDifferent ways to create a 4-byte crc32 hex str::\n\n    \u003e\u003e\u003e Hex(0x0102, 4)\n    '00000102'\n    \u003e\u003e\u003e Hex(0x0102, 'crc32')\n    '00000102'\n    \u003e\u003e\u003e Hex.crc32(0x0102)\n    '00000102'\n    \u003e\u003e\u003e Hex('00000102', 'crc32')\n    '00000102'\n    \u003e\u003e\u003e Hex.crc32('00000102')\n    '00000102'\n\n\nCreate with a tuple of prefix and a filling byte::\n\n    \u003e\u003e\u003e Hex(('12', 1), 'crc32')\n    '12010101'\n\n\nArithmetic operations::\n\n    \u003e\u003e\u003e Hex(0x0102, 'crc32') + 1\n    '00000103'\n    \u003e\u003e\u003e Hex(0x0102, 'crc32') * 2\n    '00000204'\n    \u003e\u003e\u003e Hex(0x0102, 'crc32') - 1000000\n    '00000000'\n    \u003e\u003e\u003e Hex(0x0102, 'crc32') * 1000000000\n    'ffffffff'\n\n\nIterate over sha1 space with a specific step::\n\n    \u003e\u003e\u003e Hex.sha1(0) + Hex.sha1(('10', 0))\n    '1000000000000000000000000000000000000000'\n    \u003e\u003e\u003e Hex.sha1(0) + Hex.sha1(('10', 0)) * 2\n    '2000000000000000000000000000000000000000'\n\n\n\n# Install\n\n```\npip install k3num\n```\n\n# Synopsis\n\n```python\n\u003e\u003e\u003e readable(103425)\n'101.0K'\n\u003e\u003e\u003e readable({ 'total': 10240, 'progress': [1, 1024*2.1, 1024*3.2], })\n{'total': '10K', 'progress': ['1', '2.10K', '3.20K']}\n\u003e\u003e\u003e parsenum('5.2K')\n5324.8\n\u003e\u003e\u003e parsenum('10%')\n0.1\n\u003e\u003e\u003e value_to_unit[1024**2]\n'M'\n\u003e\u003e\u003e unit_to_value['K']\n1024\n\u003e\u003e\u003e Hex(0x0102, 4)\n'00000102'\n\u003e\u003e\u003e Hex(0x0102, 'crc32')\n'00000102'\n\u003e\u003e\u003e Hex.crc32(0x0102)\n'00000102'\n\u003e\u003e\u003e Hex('00000102', 'crc32')\n'00000102'\n\u003e\u003e\u003e Hex.crc32('00000102')\n'00000102'\n\u003e\u003e\u003e Hex(('12', 1), 'crc32')\n'12010101'\n\u003e\u003e\u003e Hex(0x0102, 'crc32') + 1\n'00000103'\n\u003e\u003e\u003e Hex(0x0102, 'crc32') * 2\n'00000204'\n\u003e\u003e\u003e Hex(0x0102, 'crc32') - 1000000\n'00000000'\n\u003e\u003e\u003e Hex(0x0102, 'crc32') * 1000000000\n'ffffffff'\n\u003e\u003e\u003e Hex.sha1(0) + Hex.sha1(('10', 0))\n'1000000000000000000000000000000000000000'\n\u003e\u003e\u003e Hex.sha1(0) + Hex.sha1(('10', 0)) * 2\n'2000000000000000000000000000000000000000'\n```\n\n#   Author\n\nZhang Yanpo (张炎泼) \u003cdrdr.xp@gmail.com\u003e\n\n#   Copyright and License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Zhang Yanpo (张炎泼) \u003cdrdr.xp@gmail.com\u003e\n\n\n[pykit3]: https://github.com/pykit3","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpykit3%2Fk3num","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpykit3%2Fk3num","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpykit3%2Fk3num/lists"}