{"id":28484852,"url":"https://github.com/slightlynybbled/engineering_notation","last_synced_at":"2025-10-09T11:13:53.682Z","repository":{"id":57426449,"uuid":"92851083","full_name":"slightlynybbled/engineering_notation","owner":"slightlynybbled","description":"Easy engineering notation using python","archived":false,"fork":false,"pushed_at":"2023-12-06T13:00:31.000Z","size":58,"stargazers_count":47,"open_issues_count":3,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-22T17:12:55.261Z","etag":null,"topics":["engineering-notation"],"latest_commit_sha":null,"homepage":null,"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/slightlynybbled.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,"governance":null}},"created_at":"2017-05-30T16:04:42.000Z","updated_at":"2025-02-26T23:15:36.000Z","dependencies_parsed_at":"2023-12-06T13:26:04.005Z","dependency_job_id":"26f8f158-b245-4076-aeee-b015f36f07ba","html_url":"https://github.com/slightlynybbled/engineering_notation","commit_stats":{"total_commits":58,"total_committers":7,"mean_commits":8.285714285714286,"dds":"0.27586206896551724","last_synced_commit":"e7f29bcd6e91b83ead5a5645d7a6a1f95e078cdc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/slightlynybbled/engineering_notation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slightlynybbled%2Fengineering_notation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slightlynybbled%2Fengineering_notation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slightlynybbled%2Fengineering_notation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slightlynybbled%2Fengineering_notation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slightlynybbled","download_url":"https://codeload.github.com/slightlynybbled/engineering_notation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slightlynybbled%2Fengineering_notation/sbom","scorecard":{"id":831627,"data":{"date":"2025-08-11","repo":{"name":"github.com/slightlynybbled/engineering_notation","commit":"702c27c821c1943d0d801f52be2484a5f093bb96"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"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":"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":"Code-Review","score":3,"reason":"Found 7/23 approved changesets -- score normalized to 3","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/unittest.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/unittest.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/slightlynybbled/engineering_notation/unittest.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unittest.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/slightlynybbled/engineering_notation/unittest.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/unittest.yml:23","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand 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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.txt:0","Info: FSF or OSI recognized license: MIT License: license.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 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-23T17:55:36.762Z","repository_id":57426449,"created_at":"2025-08-23T17:55:36.762Z","updated_at":"2025-08-23T17:55:36.762Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001287,"owners_count":26083058,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["engineering-notation"],"created_at":"2025-06-07T23:08:40.414Z","updated_at":"2025-10-09T11:13:53.675Z","avatar_url":"https://github.com/slightlynybbled.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Unit Tests](https://github.com/slightlynybbled/engineering_notation/actions/workflows/unittest.yml/badge.svg)](https://github.com/slightlynybbled/engineering_notation/actions/workflows/unittest.yml)\n\n# Purpose\n\nTo easily work with human-readable engineering notation.  I wrote this as a quick tool for my own use.\nI found that I was writing the same functionality into multiple packages and would like a quick pip-installable\npackage to take care of this manipulation for me.  The package should be easily extended for other use cases.\nThe package is unit-less, so only operates on numeric values.  Unit detection may be added in future versions.\n\nMore information may be found at [for(embed)](http://forembed.com/engineering-notation-in-python.html).\n\n# Installation\n\nInstall using pip: `pip install engineering_notation`.\n\n# Status and Contributions\n\nThis project currently has 100% test coverage.  Have a look in `test.py` for examples of how to use\nthis library. To execute the tests, run `pytest` from the main directory or, \nin some environments, it may be necessary to run `python3 -m pytest`.\n\nAny contributions must pass 100% of current tests and pass flake8.  To execute\nflake8, navigate to the project directory and `python3 setup.py flake8`.\n\nYour pull request will automatically be run through testing and flake8 checks and\nany pull requests that do not pass these will be put on hold pending passing.\n\n# Use \n\nThere are multiple ways of initializing a number to a particular value, but a string is the preferred method:\n\n```\n\u003e\u003e\u003e from engineering_notation import EngNumber\n\u003e\u003e\u003e EngNumber('10k')\n10k\n\u003e\u003e\u003e EngNumber('10000')\n10k\n\u003e\u003e\u003e EngNumber(10000)\n10k\n\u003e\u003e\u003e EngNumber(10000.0)\n10k\n\u003e\u003e\u003e EngNumber(1e4)\n10k\n```\n\nWhere decimals are involved, we use a default precision of 2 digits:\n\n```\n\u003e\u003e\u003e EngNumber('4.99k')\n4.99k\n\u003e\u003e\u003e EngNumber('4.9k')\n4.90k\n```\n\nThis behavior can truncate your results in some cases, and cause your number to round.  To specify more or less\ndigits, simply specify the precision in the declaration:\n\n```\n\u003e\u003e\u003e EngNumber('4.999k')\n5k\n\u003e\u003e\u003e EngNumber('4.999k', precision=3)\n4.999k\n```\n\nMost operations that you would perform on numeric values are valid, although all operations are not implemented:\n\n```\n\u003e\u003e\u003e EngNumber('2.2k') * 2\n4.40k\n\u003e\u003e\u003e 2 * EngNumber('2.2k')\n4.40k\n\u003e\u003e\u003e EngNumber(1.2) \u003e EngNumber('3.3k') \nFalse\n\u003e\u003e\u003e EngNumber(1.2) \u003c= EngNumber('3.3k')\nTrue\n\u003e\u003e\u003e EngNumber('3.3k') == EngNumber(3300)\nTrue\n```\n\nAll of the above operations are also possible on the `EngUnit()` class as well.  The only difference is\nthat units must match for addition/subtraction/comparison operations.  Although multiplication and division\noperations will work numerically, they may not always be strictly correct.  This is because EngUnit is not\nintended to replace a computer algebra system!\n\n```\n\u003e\u003e\u003e EngUnit('2s') / EngUnit('4rotations')\n0.5s/rotations\n```\n\nAdditionally, since there are 'reserved' letters for sizing the number, you must be careful with your units!\n\n```\n\u003e\u003e\u003e EngUnit('2mm')\n2mm        # \u003c\u003c\u003c this value equivalent to \"0.002m\"\n\u003e\u003e\u003e EngUnit('2meter')\n2meter     # \u003c\u003c\u003c this value is equivalent to \"0.002eter\", the \"m\" was used to scale the unit!\n\u003e\u003e\u003e EngUnit('2', unit='meter')   # \u003c\u003c\u003c this will work better\n```\n\n# Contributions\n\nContributions are welcome.  Feel free to make feature requests in the issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslightlynybbled%2Fengineering_notation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslightlynybbled%2Fengineering_notation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslightlynybbled%2Fengineering_notation/lists"}