{"id":20169,"name":"energyusage","description":"A Python package that measures the environmental impact of computation.","url":"https://github.com/responsibleproblemsolving/energy-usage","last_synced_at":"2026-04-11T16:30:25.285Z","repository":{"id":51307113,"uuid":"197041698","full_name":"responsibleproblemsolving/energy-usage","owner":"responsibleproblemsolving","description":"Provides a function to measure the energy usage of another function.","archived":false,"fork":false,"pushed_at":"2021-06-03T19:58:58.000Z","size":1815,"stargazers_count":153,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-04-06T14:09:17.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/responsibleproblemsolving.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2019-07-15T17:17:20.000Z","updated_at":"2025-12-09T23:57:56.000Z","dependencies_parsed_at":"2022-09-12T02:30:20.823Z","dependency_job_id":null,"html_url":"https://github.com/responsibleproblemsolving/energy-usage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/responsibleproblemsolving/energy-usage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving","download_url":"https://codeload.github.com/responsibleproblemsolving/energy-usage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/sbom","scorecard":{"id":771984,"data":{"date":"2025-08-11","repo":{"name":"github.com/responsibleproblemsolving/energy-usage","commit":"b6cd5d4ee07f7c4f0f1499405c385a05654a2b3a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Code-Review","score":0,"reason":"Found 0/6 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":"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":-1,"reason":"no dependencies found","details":null,"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"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":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg"],"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 26 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-23T02:27:50.314Z","repository_id":51307113,"created_at":"2025-08-23T02:27:50.314Z","updated_at":"2025-08-23T02:27:50.314Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31560476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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"}},"owner":{"login":"responsibleproblemsolving","name":"responsibleproblemsolving","uuid":"52930580","kind":"organization","description":null,"email":null,"website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/52930580?v=4","repositories_count":2,"last_synced_at":"2023-03-11T08:20:32.942Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/responsibleproblemsolving","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-02-15T01:33:38.674Z","updated_at":"2023-03-11T08:20:32.948Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving/repositories"},"packages":[{"id":2723410,"name":"energyusage","ecosystem":"pypi","description":"Measuring the environmental impact of computation","homepage":"https://github.com/responsibleproblemsolving/energy-usage","licenses":"Apache 2.0","normalized_licenses":["Apache-2.0"],"repository_url":"https://github.com/responsibleproblemsolving/energy-usage","keywords_array":[],"namespace":null,"versions_count":14,"first_release_published_at":"2019-07-23T18:56:07.000Z","latest_release_published_at":"2019-12-13T22:16:12.000Z","latest_release_number":"0.0.14","last_synced_at":"2026-04-06T14:01:26.592Z","created_at":"2022-04-10T10:53:30.074Z","updated_at":"2026-04-06T14:01:26.592Z","registry_url":"https://pypi.org/project/energyusage/","install_command":"pip install energyusage --index-url https://pypi.org/simple","documentation_url":"https://energyusage.readthedocs.io/","metadata":{"funding":null,"documentation":null,"classifiers":["License :: OSI Approved :: Apache Software License","Operating System :: OS Independent","Programming Language :: Python :: 3"],"normalized_name":"energyusage","project_status":null},"repo_metadata":{"id":51307113,"uuid":"197041698","full_name":"responsibleproblemsolving/energy-usage","owner":"responsibleproblemsolving","description":"Provides a function to measure the energy usage of another function.","archived":false,"fork":false,"pushed_at":"2021-06-03T19:58:58.000Z","size":1815,"stargazers_count":154,"open_issues_count":6,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T20:33:45.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/responsibleproblemsolving.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2019-07-15T17:17:20.000Z","updated_at":"2024-07-07T11:48:34.000Z","dependencies_parsed_at":"2022-09-12T02:30:20.823Z","dependency_job_id":null,"html_url":"https://github.com/responsibleproblemsolving/energy-usage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving","download_url":"https://codeload.github.com/responsibleproblemsolving/energy-usage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222130620,"owners_count":16936299,"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"},"owner_record":{"login":"responsibleproblemsolving","name":"responsibleproblemsolving","uuid":"52930580","kind":"organization","description":null,"email":null,"website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/52930580?v=4","repositories_count":2,"last_synced_at":"2023-03-11T08:20:32.942Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/responsibleproblemsolving","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-02-15T01:33:38.674Z","updated_at":"2023-03-11T08:20:32.948Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/responsibleproblemsolving/repositories"},"tags":[]},"repo_metadata_updated_at":"2024-10-29T23:10:47.114Z","dependent_packages_count":0,"downloads":287,"downloads_period":"last-month","dependent_repos_count":5,"rankings":{"downloads":8.556738673482478,"dependent_repos_count":6.777322196712316,"dependent_packages_count":7.373338280337238,"stargazers_count":5.817588342325773,"forks_count":11.46814426296794,"docker_downloads_count":null,"average":7.998626351165148},"purl":"pkg:pypi/energyusage","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/pypi/energyusage","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/pypi/energyusage","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/pypi/energyusage/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2024-10-29T19:31:34.898Z","issues_count":12,"pull_requests_count":5,"avg_time_to_close_issue":219959.75,"avg_time_to_close_pull_request":921643.0,"issues_closed_count":8,"pull_requests_closed_count":3,"pull_request_authors_count":4,"issue_authors_count":9,"avg_comments_per_issue":1.25,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":3,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/issues","maintainers":[{"login":"wzziyao","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/wzziyao"}],"active_maintainers":[]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages/energyusage/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages/energyusage/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages/energyusage/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages/energyusage/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages/energyusage/codemeta","maintainers":[{"uuid":"responsibleproblemsolving","login":"responsibleproblemsolving","name":null,"email":null,"url":null,"packages_count":1,"html_url":"https://pypi.org/user/responsibleproblemsolving/","role":null,"created_at":"2023-02-23T19:05:40.756Z","updated_at":"2023-02-23T19:05:40.756Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/maintainers/responsibleproblemsolving/packages"}],"registry":{"name":"pypi.org","url":"https://pypi.org","ecosystem":"pypi","default":true,"packages_count":835813,"maintainers_count":356904,"namespaces_count":0,"keywords_count":270194,"github":"pypi","metadata":{"funded_packages_count":53084},"icon_url":"https://github.com/pypi.png","created_at":"2022-04-04T15:19:23.364Z","updated_at":"2026-04-05T05:05:39.368Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/pypi.org/namespaces"}}],"commits":{"id":574059,"full_name":"responsibleproblemsolving/energy-usage","default_branch":"master","total_commits":229,"total_committers":9,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":25.444444444444443,"dds":0.5283842794759825,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-06T14:04:17.572Z","last_synced_commit":"b6cd5d4ee07f7c4f0f1499405c385a05654a2b3a","created_at":"2023-03-09T05:33:38.413Z","updated_at":"2026-03-26T15:08:47.694Z","committers":[{"name":"Ziyao Wang","email":"ziyaow36@gmail.com","login":"wzziyao","count":108},{"name":"Silvia","email":"ssusai@haverford.edu","login":null,"count":71},{"name":"Kadan Lottick","email":"klottick@haverford.edu","login":"klottick","count":41},{"name":"Adrien Barbaresi","email":"barbaresi@bbaw.de","login":"adbar","count":3},{"name":"sorelle","email":"sorelle","login":"sorelle","count":2},{"name":"dbroth","email":"derek.roth17@gmail.com","login":"dbroth","count":1},{"name":"charliemarx","email":"charlie.t.marx@gmail.com","login":"charliemarx","count":1},{"name":"h205c","email":"h205c@smith.cs.haverford.edu","login":null,"count":1},{"name":"=","email":"=","login":null,"count":1}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-08T00:00:24.542Z","repositories_count":6212203,"commits_count":914906080,"contributors_count":35345446,"owners_count":1143114,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"responsibleproblemsolving/energy-usage","html_url":"https://github.com/responsibleproblemsolving/energy-usage","last_synced_at":"2025-09-01T03:05:38.127Z","status":"error","issues_count":12,"pull_requests_count":5,"avg_time_to_close_issue":219959.75,"avg_time_to_close_pull_request":921643.0,"issues_closed_count":8,"pull_requests_closed_count":3,"pull_request_authors_count":4,"issue_authors_count":9,"avg_comments_per_issue":1.25,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":3,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2023-05-09T10:34:55.376Z","updated_at":"2025-09-01T03:05:38.127Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/responsibleproblemsolving%2Fenergy-usage/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":12},"pull_request_author_associations_count":{"NONE":2,"COLLABORATOR":2,"CONTRIBUTOR":1},"issue_authors":{"alexmherrmann":4,"thibaudcolas":1,"annlor":1,"matbeseris":1,"NSVR57":1,"CesarCastellonE":1,"AmitChaulwar":1,"sakuras-ya":1,"jumpsnack":1},"pull_request_authors":{"wzziyao":2,"annlor":1,"vosps":1,"adbar":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-06T00:00:09.270Z","repositories_count":14106272,"issues_count":34454647,"pull_requests_count":112472246,"authors_count":11227558,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{},"past_year_pull_request_authors":{},"maintainers":[{"login":"wzziyao","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/wzziyao"}],"active_maintainers":[]},"events":{"total":{"WatchEvent":1},"last_year":{}},"keywords":[],"dependencies":[{"ecosystem":"pypi","filepath":"requirements.txt","sha":null,"kind":"manifest","created_at":"2022-09-12T02:30:20.708Z","updated_at":"2022-09-12T02:30:20.708Z","repository_link":"https://github.com/responsibleproblemsolving/energy-usage/blob/master/requirements.txt","dependencies":[{"id":4557032408,"package_name":"requests","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false}]}],"score":12.946301388573518,"created_at":"2023-09-11T14:52:10.354Z","updated_at":"2026-04-11T16:30:25.292Z","avatar_url":"https://github.com/responsibleproblemsolving.png","language":"Python","category":"Consumption","sub_category":"Computation and Communication","monthly_downloads":287,"total_dependent_repos":5,"total_dependent_packages":0,"readme":"# See [CodeCarbon](https://codecarbon.io/) instead!\nWe are no longer actively maintaining this project, since we have merged its functionality into another project that is being actively maintained and has more features than this one.  We recommend using that project instead!\n\n# energyusage\n\nA Python package that measures the environmental impact of computation. Provides a function to\nevaluate the energy usage and related carbon emissions of another function.\nEmissions are calculated based on the user's location via the GeoJS API and that location's\nenergy mix data (sources: US E.I.A and eGRID for the year 2016).\n\n## Installation\n\nTo install, simply `$ pip install energyusage`.\n\n## Usage\n\nTo evaluate the emissions of a function, just call `energyusage.evaluate` with the function\nname and the arguments it requires. Use `python3` to run your code.\n\n```python\nimport energyusage\n\n# user function to be evaluated\ndef recursive_fib(n):\n    if (n \u003c= 2): return 1\n    else: return recursive_fib(n-1) + recursive_fib(n-2)\n\nenergyusage.evaluate(recursive_fib, 40, pdf=True)\n# returns 102,334,155\n```\nIt will return the value of your function, while also printing out the energy usage report on the command line.\nOptional keyword arguments:\n* `pdf`(default = `False`): generates a PDF report, alongside the command-line utility\n* `powerLoss` (default = `0.8`): accounts for PSU loss, can be set by user if known for higher accuracy of results\n* `energyOutput` (default = `False`): prints amount of energy used by the process and time taken. The order is time, energy used, return of function\n* `printToScreen` (default = `True`): controls whether there is a terminal printout of the package running\n* `energyOutput` (default = `False`): determines whether the energy used and time taken are output. When set to true the order is `time used`, `energy used`, `return value of function`.\n* `locations` (default = `[\"Mongolia\", \"Iceland\", \"Switzerland\"]`): allows selecting the countries in the emissions comparison section for the terminal printout and pdf. These can be set to the name of any country or US state.\n* `year` (default = `2016`): controls the year for the data. Default is `2016` as that is currently the most recent year of data from both of our sources. Note that only this year of data is included in the package installation but more can be added in a process described later.\n\n### Energy Report\nThe report that will be printed out will look like the one below. The second and third lines will show a real-time reading that disappears once the process has finished evaluating.\n```\nLocation:                                                           Pennsylvania\n--------------------------------------------------------------------------------\n-------------------------------  Final Readings  -------------------------------\n--------------------------------------------------------------------------------\nAverage baseline wattage:                                             1.86 watts\nAverage total wattage:                                               19.42 watts\nAverage process wattage:                                             17.56 watts\nProcess duration:                                                        0:00:01\n--------------------------------------------------------------------------------\n-------------------------------   Energy Data    -------------------------------\n--------------------------------------------------------------------------------\n                           Energy mix in Pennsylvania                           \nCoal:                                                                     25.42%\nOil:                                                                       0.17%\nNatural Gas:                                                              31.64%\nLow Carbon:                                                               42.52%\n--------------------------------------------------------------------------------\n-------------------------------    Emissions     -------------------------------\n--------------------------------------------------------------------------------\nEffective emission:                                              4.05e-06 kg CO2\nEquivalent miles driven:                                          1.66e-12 miles\nEquivalent minutes of 32-inch LCD TV watched:                   2.51e-03 minutes\nPercentage of CO2 used in a US household/day:                          1.33e-12%\n--------------------------------------------------------------------------------\n------------------------- Assumed Carbon Equivalencies -------------------------\n--------------------------------------------------------------------------------\nCoal:                                                      995.725971 kg CO2/MWh\nPetroleum:                                                816.6885263 kg CO2/MWh\nNatural gas:                                              743.8415916 kg CO2/MWh\nLow carbon:                                                         0 kg CO2/MWh\n--------------------------------------------------------------------------------\n-------------------------     Emissions Comparison     -------------------------\n--------------------------------------------------------------------------------\n                      Quantities below expressed in kg CO2                      \n        US                      Europe                  Global minus US/Europe\nMax:    Wyoming        9.59e-06 Kosovo         9.85e-06 Mongolia        9.64e-06\nMedian: Tennessee      4.70e-06 Ukraine        6.88e-06 Korea, South    7.87e-06\nMin:    Vermont        2.69e-07 Iceland        1.77e-06 Bhutan          1.10e-06\n--------------------------------------------------------------------------------\n--------------------------------------------------------------------------------\nProcess used:                                                       1.04e-05 kWh\n```\nThe report is divided into several sections.\n* **Final Readings**: Presents an average of:\n\t* *Average baseline wattage*: your computer's average power usage minus the process, ran for 10 seconds before starting your process\n\t* *Average total wattage*: your computer's average power usage while the process runs\n\t* *Average process usage*: the difference between the baseline and total, highlighting the usage solely from the specific process you evaluated\n\t* *Process duration*: how long your program ran for\n\n* **Energy Data**: The energy mix of the location.\n\n* **Emissions**: The effective CO\u003csub\u003e2\u003c/sub\u003e emissions of running the program one time and some real-world equivalents to those emissions.\n\n* **Assumed Carbon Equivalencies**: The formulas used to convert from kWh to CO\u003csub\u003e2\u003c/sub\u003e based on the energy mix of the location (for international locations, see below for more information).\n\n* **Emissions Comparison**: What the emissions would be for the same energy used in a representative group of US states and countries. Note that if these locations are specified as described below these default values are not shown.\n\n* **Process used**: The amount of energy running the program used in total.\n\nThe PDF report contains the same sections, but does not include the process duration or the emissions comparison momentarily.\n\n## Methodology\n### Power Measurement\n#### CPU\nWe calculate CPU power usage via the RAPL (Running Average Power Limit) interfaces found on Intel processors. These are non-architectural model-specific registers that provide power-related information\nabout the CPU. They are used primarily for limiting power consumption, but the Energy Status\nregister (MSR_PKG_ENERGY_STATUS) allows for power measurement.\n\nThe RAPL interface differentiates between several domains, based on the number of processors. For a single processor machine:\n  * Package\n  * Power planes:\n      * Core\n      * Uncore\n  * DRAM\n\nFor a machine with multiple processors:\n  * Package 0\n  * Package 1\n  * ...\n  * Package n\n  * DRAM\n\nPresently, we use the Package domain (or a sum of all of the domains, for a multi-processor machine), which represents the complete processor package.\n\nAs outlined by [Vince Weaver](http://web.eece.maine.edu/~vweaver/projects/rapl/), there are multiple ways to access the RAPL interface data, namely:\n * Using perf_event interface\n * Reading the underlying MSR\n * Reading the files under `/sys/class/powercap/intel-rapl/`\n\nWe elected to use the final method because it is the only one that does not require sudo access.  We read the `energy_uj.txt` files inside the package folder(s) `intel-rapl:*`. These files represent the energy used in microjoules, and they update roughly every millisecond. The value in the file increases to the point of overflow and then resets. We take 2 readings with a delay in-between, and then calculate the wattage based on the difference (energy) and the delay (time). To avoid errors due to the reset of the file, we discard negative values.\n\nFor more information on the RAPL interface, consult the [Intel® 64 and IA-32 Architectures Software Developer's Manual](https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf).\n\n#### GPU\nTo the package measurement we also add the power usage of the GPU for machines that have an Nvidia GPU that support the NVIDIA-smi program.\n\nThe NVIDIA-smi is a command-line utility that allows for the querying of information about the GPU. If the GPU is identified as valid, we use the built-in method to query the current wattage, and then convert the output into a float.\n\nMore  information on NVIDIA-smi can be found on the [Nvidia website](https://developer.nvidia.com/nvidia-system-management-interface).\n\n\n### Calculating CO\u003csub\u003e2\u003c/sub\u003e Emissions\n#### Location\nIn order to accurately calculate the CO₂ emissions associated with the computational power used, we determine the geographical location of the user via their IP address with the help of the [GeoJS](https://www.geojs.io/) API.  If the location cannot be determined, we use the United States as the default.\n\nLocation is especially important as the emissions differ based on the country's (and, in the case of the United States, the state's) energy mix.\n\n#### Energy Mix Information\nWe obtained international energy mix data from the [U.S. Energy Information Administration data](https://www.eia.gov/beta/international/data/browser/#/?pa=0000000010000000000000000000000000000000000000000000000000u\u0026c=ruvvvvvfvsujvv1vrvvvvfvvvvvvfvvvou20evvvfvrvvvvvvurs\u0026ct=0\u0026vs=INTL.44-2-AFG-QBTU.A\u0026cy=2016\u0026vo=0\u0026v=H\u0026start=2014\u0026end=2016) for the year 2016. Specifically, we looked at the energy consumption of countries worldwide, broken down by energy source. For the data points labeled *(s)* (meaning that the value is too small for the number of decimal places shown), we approximated those amounts to 0. No data was available for, and thus we removed from consideration, the following: Former Czechoslovakia, Former Serbia and Montenegro, Former U.S.S.R., Former Yugoslavia, Hawaiian Trade Zone, East Germany and West Germany.\n\nOur United States energy mix and emissions data was obtained from the [U.S. Environmental Protection Agency eGRID data](https://www.epa.gov/sites/production/files/2018-02/egrid2016_summarytables.xlsx) for the year 2016. We used the *State Resource Mix* section for displaying the energy mix, and the *State Output Emission Rates* section for calculating emissions in the United States. We did not use the *otherFossil* data as the values were predominantly 0 (and in cases in which the value was nonzero, it was below 1%).\n\nAs of July 2019, the most recent eGRID data was from the year 2016. We elected to use 2016 U.S. E.I.A. data for consistency between the data sources.\n\n#### Conversion to CO\u003csub\u003e2\u003c/sub\u003e\nSince the international data only contained an energy mix, and no emission data, we reverse-engineered the formulas used in the eGRID data. This gives us additionally consistency between the separate datasets.\n* *Coal*: 2195.20 lbs CO\u003csub\u003e2\u003c/sub\u003e/MWh = 995.725971 kg CO\u003csub\u003e2\u003c/sub\u003e/MWh\n* *Petroleum*: 1800.49 lbs CO\u003csub\u003e2\u003c/sub\u003e/MWh = 816.6885263 kg CO\u003csub\u003e2\u003c/sub\u003e/MWh\n* *Natural gas*: 1639.89 lbs CO\u003csub\u003e2\u003c/sub\u003e/MWh = 743.8415916 kg CO\u003csub\u003e2\u003c/sub\u003e/MWh\n\n#### Using Different Years of Data\nIn case one wishes to compare energy usage between different years of data, we have included a script to allow for adding other years. If you navigate to the package directory and go into the `data` folder, you can use `raw_to_json.py`. First, you need to download the US and international data in the years of your choice from the links above and place them in `data/raw/\"year of the data\"` after creating the required year folder. Then, run the script with a flag for that year (for example, `python raw_to_json.py -2016`). This will allow selecting that year when using package in the future by using the `year` optional argument for `evaluate`.\n\n## Related Work\n* In their paper [*Energy and Policy Considerations for Deep Learning in NLP*](https://arxiv.org/abs/1906.02243), Strubell et. al not only analyze the computational power needed for training deep learning models in NLP, but further convert the data into carbon emissions and cost. Our tool aims to facilitate this analysis for developers in a single package. We do not consider cost, instead choosing to focus solely on the environmental impact. Further, we do not focus on a specific computational area. We also extend their analysis of carbon emissions by including international data on energy consumption and CO\u003csub\u003e2\u003c/sub\u003e emissions for localized analysis of the carbon footprint of the tested program.\n\n## Limitations\n* Due to the methods in which the energy measurement is being done (through the Intel RAPL\ninterface and NVIDIA-smi), our package is only available on Linux kernels that have the\nRAPL interface and/or machines with an Nvidia GPU.\n\n*  A country’s overall energy consumption mix is not necessarily representative of the mix of energy sources used to produce electricity (and even electricity production is not necessarily representative of electricity consumption due to imports/exports). However, the E.I.A. data is the most geographically comprehensive that we have found. We are working on obtaining even more accurate data.\n\n\n## Acknowledgements\nWe would like to thank [Jon Wilson](https://www.haverford.edu/users/jwilson) for all his valuable insight with regards to the environmental aspect of our project.\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":["topic-modeling"],"project_url":"https://ost.ecosyste.ms/api/v1/projects/20169","html_url":"https://ost.ecosyste.ms/projects/20169"}