{"id":37076301,"url":"https://github.com/dw61/electronvolt","last_synced_at":"2026-01-14T08:58:38.273Z","repository":{"id":45967991,"uuid":"305151115","full_name":"dw61/electronvolt","owner":"dw61","description":"A physics quantity calculator with units.","archived":false,"fork":false,"pushed_at":"2021-12-04T03:06:03.000Z","size":269,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T11:36:19.209Z","etag":null,"topics":["physics"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/electronvolt","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/dw61.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}},"created_at":"2020-10-18T16:54:10.000Z","updated_at":"2023-07-04T09:16:10.000Z","dependencies_parsed_at":"2022-09-19T06:50:47.298Z","dependency_job_id":null,"html_url":"https://github.com/dw61/electronvolt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dw61/electronvolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dw61%2Felectronvolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dw61%2Felectronvolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dw61%2Felectronvolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dw61%2Felectronvolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dw61","download_url":"https://codeload.github.com/dw61/electronvolt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dw61%2Felectronvolt/sbom","scorecard":{"id":361062,"data":{"date":"2025-08-11","repo":{"name":"github.com/dw61/electronvolt","commit":"4fafbab5994b08338f4c9b0e64f6b57a9fbef8b5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 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":"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":"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":"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":"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":"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/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dw61/electronvolt/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/dw61/electronvolt/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/dw61/electronvolt/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dw61/electronvolt/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:18","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.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":"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":"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":"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":"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":"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 17 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-18T10:52:03.518Z","repository_id":45967991,"created_at":"2025-08-18T10:52:03.518Z","updated_at":"2025-08-18T10:52:03.518Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"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":["physics"],"created_at":"2026-01-14T08:58:37.742Z","updated_at":"2026-01-14T08:58:38.265Z","avatar_url":"https://github.com/dw61.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo\n\n#### Import module\n```python\n\u003e\u003e\u003e from electronvolt import *\n```\n\n#### Rest mass of an electron\n```python\n\u003e\u003e\u003e me\n9.1093837015e-31 * kg\n```\n\n#### Rest energy of the electron, in [SI](https://en.wikipedia.org/wiki/International_System_of_Units) units\n```python\n\u003e\u003e\u003e me * c**2\n8.187105776823886e-14 * m**2 * s**-2 * kg\n```\n\n#### In mega electronvolts\n```python\n\u003e\u003e\u003e me * c**2 / MeV\n0.5109989499961642\n```\n\nThis matches the electron rest energy on [Wikipedia](https://en.wikipedia.org/wiki/Electron_rest_mass).\n\n# Usage\n\nInstall via `pip install electronvolt`.\n\n#### Alternatively, run this module [online](https://mybinder.org/v2/gh/dw61/electronvolt/HEAD?filepath=online.ipynb)\n* Typically loads within 3 minutes.\n* Shift+enter to run a block of code. Run first block to initialize the calculator.\n\n# Units and Constants\n\n|Name                           |Symbol    |Value               |Unit                         |\n|-------------------------------|----------|--------------------|-----------------------------|\n|                               |          |                    |                             |\n|**Math Constants**             |          |                    |                             |\n|                               |`pi`      |3.141592653589793   |                             |\n|Euler's number                 |`euler`   |2.718281828459045   |                             |\n|                               |          |                    |                             |\n|**Metric Prefixes**            |          |                    |                             |\n|                               |`yotta`   |1 `e+24`            |                             |\n|                               |`zetta`   |1 `e+21`            |                             |\n|                               |`exa`     |1 `e+18`            |                             |\n|                               |`peta`    |1 `e+15`            |                             |\n|                               |`tera`    |1 `e+12`            |                             |\n|                               |`giga`    |1 `e+09`            |                             |\n|                               |`mega`    |1000000             |                             |\n|                               |`kilo`    |1000                |                             |\n|                               |`hecto`   |100                 |                             |\n|                               |`deca`    |10                  |                             |\n|                               |`deci`    |0.1                 |                             |\n|                               |`centi`   |0.01                |                             |\n|                               |`milli`   |0.001               |                             |\n|                               |`micro`   |1 `e-06`            |                             |\n|                               |`nano`    |1 `e-09`            |                             |\n|                               |`pico`    |1 `e-12`            |                             |\n|                               |`femto`   |1 `e-15`            |                             |\n|                               |`atto`    |1 `e-18`            |                             |\n|                               |`zepto`   |1 `e-21`            |                             |\n|                               |`yocto`   |1 `e-24`            |                             |\n|                               |          |                    |                             |\n|**Common Prefixes**            |          |                    |                             |\n|                               |`hundred` |100                 |                             |\n|                               |`thousand`|1000                |                             |\n|                               |`million` |1000000             |                             |\n|                               |`billion` |1 `e+09`            |                             |\n|                               |`trillion`|1 `e+12`            |                             |\n|                               |          |                    |                             |\n|**SI Base Units**              |          |                    |                             |\n|second                         |`s`       |1                   |`s`                          |\n|meter                          |`m`       |1                   |`m`                          |\n|kilogram                       |`kg`      |1                   |`kg`                         |\n|ampere                         |`A`       |1                   |`A`                          |\n|kelvin                         |`K`       |1                   |`K`                          |\n|mole                           |`mol`     |1                   |`mol`                        |\n|candela                        |`cd`      |1                   |`cd`                         |\n|                               |          |                    |                             |\n|**Time**                       |          |                    |                             |\n|                               |`minute`  |60                  |`s`                          |\n|                               |`hour`    |3600                |`s`                          |\n|                               |`day`     |86400               |`s`                          |\n|                               |`week`    |604800              |`s`                          |\n|                               |`year`    |31557600            |`s`                          |\n|millisecond                    |`ms`      |0.001               |`s`                          |\n|microsecond                    |`us`      |1 `e-06`            |`s`                          |\n|nanosecond                     |`ns`      |1 `e-09`            |`s`                          |\n|                               |          |                    |                             |\n|**Length**                     |          |                    |                             |\n|kilometer                      |`km`      |1000                |`m`                          |\n|decimeter                      |`dm`      |0.1                 |`m`                          |\n|centimeter                     |`cm`      |0.01                |`m`                          |\n|millimeter                     |`mm`      |0.001               |`m`                          |\n|micrometer                     |`um`      |1 `e-06`            |`m`                          |\n|nanometer                      |`nm`      |1 `e-09`            |`m`                          |\n|picometer                      |`pm`      |1 `e-12`            |`m`                          |\n|femtometer                     |`fm`      |1 `e-15`            |`m`                          |\n|                               |          |                    |                             |\n|**Frequency**                  |          |                    |                             |\n|hertz                          |`Hz`      |1                   |`s-1`                        |\n|kilohertz                      |`kHz`     |1000                |`s-1`                        |\n|megahertz                      |`MHz`     |1000000             |`s-1`                        |\n|gigahertz                      |`GHz`     |1 `e+09`            |`s-1`                        |\n|terahertz                      |`THz`     |1 `e+12`            |`s-1`                        |\n|                               |          |                    |                             |\n|**Classical Mechanics**        |          |                    |                             |\n|gravitational acceleration     |`g`       |9.80665             |`m` `s-2`                    |\n|newton                         |`N`       |1                   |`kg` `m` `s-2`               |\n|pascal                         |`Pa`      |1                   |`kg` `m-1` `s-2`             |\n|joule                          |`J`       |1                   |`kg` `m2` `s-2`              |\n|watt                           |`W`       |1                   |`kg` `m2` `s-3`              |\n|                               |          |                    |                             |\n|**Thermodynamics**             |          |                    |                             |\n|Planck constant                |`h`       |6.62607015 `e-34`   |`kg` `m2` `s-1`              |\n|reduced Planck constant        |`hbar`    |1.05457181765 `e-34`|`kg` `m2` `s-1`              |\n|Avogadro constant              |`NA`      |6.02214076 `e+23`   |`mol-1`                      |\n|Boltzmann constant             |`kB`      |1.380649 `e-23`     |`kg` `m2` `s-2` `K-1`        |\n|ideal gas constant             |`R`       |8.31446261815324    |`kg` `mol-1` `K-1` `m2` `s-2`|\n|                               |          |                    |                             |\n|**Electromagnetism**           |          |                    |                             |\n|coulomb                        |`C`       |1                   |`s` `A`                      |\n|volt                           |`V`       |1                   |`kg` `A-1` `m2` `s-3`        |\n|farad                          |`F`       |1                   |`kg-1` `A2` `m-2` `s4`       |\n|                               |`Ohm`     |1                   |`kg` `A-2` `m2` `s-3`        |\n|tesla                          |`T`       |1                   |`kg` `A-1` `s-2`             |\n|weber                          |`Wb`      |1                   |`kg` `m2` `s-2` `A-1`        |\n|henry                          |`H`       |1                   |`kg` `A-2` `m2` `s-2`        |\n|speed of light                 |`c`       |299792458           |`m` `s-1`                    |\n|vacuum magnetic permeability   |`mu0`     |1.25663706212 `e-06`|`kg` `A-2` `m` `s-2`         |\n|vacuum electric permittivity   |`epsilon0`|8.8541878128 `e-12` |`kg-1` `m-3` `s4` `A2`       |\n|Coulomb constant               |`k`       |8987551792.26078    |`kg` `m3` `s-4` `A-2`        |\n|elementary charge              |`e`       |1.602176634 `e-19`  |`s` `A`                      |\n|                               |          |                    |                             |\n|**Imperial Units**             |          |                    |                             |\n|inch ('in' is a python keyword)|`in_`     |0.0254              |`m`                          |\n|foot                           |`ft`      |0.3048              |`m`                          |\n|yard                           |`yd`      |0.9144              |`m`                          |\n|mile                           |`mi`      |1609.344            |`m`                          |\n|                               |`acre`    |4046.8564224        |`m2`                         |\n|nautical mile                  |`NM`      |1852                |`m`                          |\n|knot                           |`kn`      |0.514444444444445   |`m` `s-1`                    |\n|US gallon                      |`gal`     |0.003785411784      |`m3`                         |\n|pound-mass                     |`lb`      |0.45359237          |`kg`                         |\n|pound-force                    |`lbf`     |4.4482216152605     |`kg` `m` `s-2`               |\n|                               |`slug`    |14.59390293720637   |`kg`                         |\n|                               |`blob`    |175.1268352464764   |`kg`                         |\n|                               |          |                    |                             |\n|**Common Units**               |          |                    |                             |\n|kilometer per hour             |`kph`     |0.277777777777778   |`m` `s-1`                    |\n|miles per hour                 |`mph`     |0.44704             |`m` `s-1`                    |\n|                               |`gram`    |0.001               |`kg`                         |\n|liter                          |`L`       |0.001               |`m3`                         |\n|pound per square inch          |`psi`     |6894.757            |`kg` `m-1` `s-2`             |\n|kilowatt-hour                  |`kWh`     |3600000             |`kg` `m2` `s-2`              |\n|hectare                        |`ha`      |10000               |`m2`                         |\n|                               |          |                    |                             |\n|**Atomic Physics**             |          |                    |                             |\n|electron rest mass             |`me`      |9.1093837015 `e-31` |`kg`                         |\n|proton mass                    |`mp`      |1.67262192369 `e-27`|`kg`                         |\n|neutron mass                   |`mn`      |1.67492749804 `e-27`|`kg`                         |\n|atomic mass unit               |`u`       |1.6605390666 `e-27` |`kg`                         |\n|atomic mass of hydrogen        |`mH`      |1.6735327848 `e-27` |`kg`                         |\n|atomic mass of helium          |`mHe`     |6.64647698905 `e-27`|`kg`                         |\n|                               |          |                    |                             |\n|**Quantum Mechanics**          |          |                    |                             |\n|Stefan-Boltzmann constant      |`sigma`   |5.67037441918 `e-08`|`kg` `K-4` `s-3`             |\n|Bohr radius                    |`a0`      |5.29177210906 `e-11`|`m`                          |\n|hydrogen ground state energy   |`hground` |-2.1798723611 `e-18`|`kg` `m2` `s-2`              |\n|fine-structure constant        |`alpha`   |0.007297352569278   |                             |\n|Rydberg constant               |`Rydberg` |10973731.56807162   |`m-1`                        |\n|                               |          |                    |                             |\n|**Radioactive Decays**         |          |                    |                             |\n|becquerel                      |`Bq`      |1                   |`s-1`                        |\n|curie                          |`Ci`      |3.7 `e+10`          |`s-1`                        |\n|millicurie                     |`mCi`     |37000000            |`s-1`                        |\n|microcurie                     |`uCi`     |37000               |`s-1`                        |\n|                               |          |                    |                             |\n|**Nuclear Physics**            |          |                    |                             |\n|electronvolt                   |`eV`      |1.602176634 `e-19`  |`kg` `m2` `s-2`              |\n|kilo-electronvolt              |`keV`     |1.602176634 `e-16`  |`kg` `m2` `s-2`              |\n|mega-electronvolt              |`MeV`     |1.602176634 `e-13`  |`kg` `m2` `s-2`              |\n|giga-electronvolt              |`GeV`     |1.602176634 `e-10`  |`kg` `m2` `s-2`              |\n|tera-electronvolt              |`TeV`     |1.602176634 `e-07`  |`kg` `m2` `s-2`              |\n|electronvolt per speed of light|`eVpc`    |5.34428599268 `e-28`|`kg` `m` `s-1`               |\n|mega-electronvolt per c        |`MeVpc`   |5.34428599268 `e-22`|`kg` `m` `s-1`               |\n|electronvolt per c squared     |`eVpc2`   |1.78266192163 `e-36`|`kg`                         |\n|mega-electronvolt per c squared|`MeVpc2`  |1.78266192163 `e-30`|`kg`                         |\n|                               |          |                    |                             |\n|**Cosmology**                  |          |                    |                             |\n|gravitational constant         |`G`       |6.6743 `e-11`       |`kg-1` `m3` `s-2`            |\n|astronomical unit              |`au`      |149597870700        |`m`                          |\n|light-year                     |`ly`      |9460730472580800    |`m`                          |\n|parsec                         |`pc`      |3.08567758149 `e+16`|`m`                          |\n|megaparsec                     |`Mpc`     |3.08567758149 `e+22`|`m`                          |\n|Hubble parameter               |`H0`      |2.3333610884 `e-18` |`s-1`                        |\n\n# More Demo\n\n#### Import `ufloat` from [uncertainties](https://github.com/lebigot/uncertainties)\n```python\n\u003e\u003e\u003e from uncertainties import ufloat\n```\n\n#### Rest mass of an electron\n```python\n\u003e\u003e\u003e me = ufloat(9.1093837015, 0.0000000028) * 1e-31 * kg\n```\n\n#### Rest energy of the electron\n```python\n\u003e\u003e\u003e me * c**2\n(8.1871057768+/-0.0000000025)e-14 * kg * s**-2 * m**2\n```\n\nThis matches the electron rest energy on the [same](https://en.wikipedia.org/wiki/Electron_rest_mass) Wikipedia page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdw61%2Felectronvolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdw61%2Felectronvolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdw61%2Felectronvolt/lists"}