codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.

https://github.com/mlco2/codecarbon

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    4 of 95 committers (4.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords from Contributors

transformer jax cryptocurrency audio speech-recognition cryptography tensors model-hub pretrained-models pytorch-transformers
Last synced: 6 months ago · JSON representation

Repository

Track emissions from Compute and recommend ways to reduce their impact on the environment.

Basic Info
Statistics
  • Stars: 1,541
  • Watchers: 20
  • Forks: 221
  • Open Issues: 123
  • Releases: 52
Created almost 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Security

README.md

banner

Estimate and track carbon emissions from your computer, quantify and analyze their impact.

Documentation


DOI Downloads OpenSSF Scorecard

About CodeCarbon 💡

CodeCarbon started with a quite simple question:

What is the carbon emission impact of my computer program? :shrug:

We found some global data like "computing currently represents roughly 0.5% of the world’s energy consumption" but nothing on our individual/organisation level impact.

At CodeCarbon, we believe, along with Niels Bohr, that "Nothing exists until it is measured". So we found a way to estimate how much CO2 we produce while running our code.

How?

We created a Python package that estimates your hardware electricity power consumption (GPU + CPU + RAM) and we apply to it the carbon intensity of the region where the computing is done.

calculation Summary

We explain more about this calculation in the Methodology section of the documentation.

Our hope is that this package will be used widely for estimating the carbon footprint of computing, and for establishing best practices with regards to the disclosure and reduction of this footprint.

So ready to "change the world one run at a time"? Let's start with a very quick set up.

Quickstart 🚀

Installation 🔧

From PyPI repository python pip install codecarbon

From Conda repository python conda install -c codecarbon codecarbon To see more installation options please refer to the documentation: Installation

Start to estimate your impact 📏

Without using the online dashboard

python from codecarbon import track_emissions @track_emissions() def your_function_to_track(): # your code

After running your code, you will find an emissions.csv that you can visualize with carbonboard --filepath="examples/emissions.csv".

With the online dashboard

To use the online dashboard you need to create an account on CodeCarbon Dashboard. Once you have an account, you can create an experiment_id to track your emissions.

To get an experimentid enter: python ! codecarbon login You can now store it in a .codecarbon.config at the root of your project ```python [codecarbon] loglevel = DEBUG savetoapi = True experimentid = 2bcbcbb8-850d-4692-af0d-76f6f36d79b2 #the experimentid you get with init ``` Now you have 2 main options:

Monitoring your machine 💻

In your command prompt use: codecarbon monitor The package will track your emissions independently from your code.

In your Python code 🐍

python from codecarbon import track_emissions @track_emissions() def your_function_to_track(): # your code The package will track the emissions generated by the execution of your function.

There is other ways to use codecarbon package, please refer to the documentation to learn more about it: Usage

Visualize 📊

You can now visualize your experiment emissions on the dashboard. dashboard

Hope you enjoy your first steps monitoring your carbon computing impact! Thanks to the incredible codecarbon community 💪🏼 a lot more options are available using codecarbon including: - offline mode - cloud mode - comet integration...

Please explore the Documentation to learn about it If ever what your are looking for is not yet implemented, let us know through the issues and even better become one of our 🦸🏼‍♀️🦸🏼‍♂️ contributors! more info 👇🏼

Contributing 🤝

We are hoping that the open-source community will help us edit the code and make it better!

You are welcome to open issues, even suggest solutions and better still contribute the fix/improvement! We can guide you if you're not sure where to start but want to help us out 🥇

In order to contribute a change to our code base, please submit a pull request (PR) via GitHub and someone from our team will go over it and accept it.

Check out our contribution guidelines :arrowupperright:

Contact @vict0rsch to be added to our slack workspace if you want to contribute regularly!

How To Cite 📝

If you find CodeCarbon useful for your research, you can find a citation under a variety of formats on Zenodo.

Here is a sample for BibTeX: tex @software{benoit_courty_2024_11171501, author = {Benoit Courty and Victor Schmidt and Sasha Luccioni and Goyal-Kamal and MarionCoutarel and Boris Feld and Jérémy Lecourt and LiamConnell and Amine Saboni and Inimaz and supatomic and Mathilde Léval and Luis Blanche and Alexis Cruveiller and ouminasara and Franklin Zhao and Aditya Joshi and Alexis Bogroff and Hugues de Lavoreille and Niko Laskaris and Edoardo Abati and Douglas Blank and Ziyao Wang and Armin Catovic and Marc Alencon and Michał Stęchły and Christian Bauer and Lucas Otávio N. de Araújo and JPW and MinervaBooks}, title = {mlco2/codecarbon: v2.4.1}, month = may, year = 2024, publisher = {Zenodo}, version = {v2.4.1}, doi = {10.5281/zenodo.11171501}, url = {https://doi.org/10.5281/zenodo.11171501} }

Contact 📝

Maintainers are @vict0rsch @benoit-cty and @SaboniAmine. Codecarbon is developed by volunteers from Mila and the DataForGoodFR community alongside donated professional time of engineers at Comet.ml and BCG GAMMA.

Star History

Comparison of the number of stars accumulated by the different Python CO2 emissions projects: Star History Chart

Owner

  • Name: CodeCarbon
  • Login: mlco2
  • Kind: organization

GitHub Events

Total
  • Create event: 115
  • Release event: 17
  • Issues event: 92
  • Watch event: 331
  • Delete event: 80
  • Member event: 1
  • Issue comment event: 270
  • Push event: 458
  • Pull request event: 231
  • Pull request review event: 226
  • Pull request review comment event: 79
  • Fork event: 44
Last Year
  • Create event: 115
  • Release event: 17
  • Issues event: 92
  • Watch event: 331
  • Delete event: 80
  • Member event: 1
  • Issue comment event: 270
  • Push event: 458
  • Pull request event: 231
  • Pull request review event: 226
  • Pull request review comment event: 79
  • Fork event: 44

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,942
  • Total Committers: 95
  • Avg Commits per committer: 20.442
  • Development Distribution Score (DDS): 0.847
Past Year
  • Commits: 452
  • Committers: 29
  • Avg Commits per committer: 15.586
  • Development Distribution Score (DDS): 0.622
Top Committers
Name Email Commits
benoit-cty 6****y 298
benoit-cty 4****y@u****v 266
vict0rsch v****h@p****e 193
Kamal Goyal g****l@b****m 182
MarionCoutarel m****z@g****m 108
inimaz 4****z 88
LuisBlanche l****r@g****m 83
jl-datascientist j****e@g****m 51
Boris Feld l****n@g****m 48
Liam Connell c****m@b****m 39
Amine Saboni a****i@o****m 37
Amine Saboni 4****e 34
patrick.lloret@protonmail.com p****t@p****m 33
benoit-cty b****y@e****m 30
benoit-cty b****y@l****v 29
dependabot[bot] 4****] 26
Alexis Cruveiller a****r@g****m 24
Mathilde Léval m****l@g****m 22
OUMINA-SARA o****a@b****m 22
Zhao Franklin q****o@b****u 22
Mathilde Leval m****l@c****m 18
MyGodItsFull0fStars c****r@e****t 18
Jerry Laruba Festus j****s@g****m 17
Sasha Luccioni l****s@m****c 17
Aditya Joshi 1****i@g****m 17
Kamal Nayan Goyal k****l 16
AlexisBogroff a****f@g****m 14
Hugues Souchard de Lavoreille h****l@g****m 14
Nikolas Laskaris l****k@g****m 13
Alexandre Phiev a****v@g****m 13
and 65 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 375
  • Total pull requests: 742
  • Average time to close issues: 6 months
  • Average time to close pull requests: 23 days
  • Total issue authors: 181
  • Total pull request authors: 91
  • Average comments per issue: 2.49
  • Average comments per pull request: 0.88
  • Merged pull requests: 599
  • Bot issues: 0
  • Bot pull requests: 56
Past Year
  • Issues: 90
  • Pull requests: 292
  • Average time to close issues: 20 days
  • Average time to close pull requests: 10 days
  • Issue authors: 56
  • Pull request authors: 27
  • Average comments per issue: 1.21
  • Average comments per pull request: 0.5
  • Merged pull requests: 215
  • Bot issues: 0
  • Bot pull requests: 31
Top Authors
Issue Authors
  • benoit-cty (55)
  • vict0rsch (26)
  • inimaz (16)
  • LiamConnell (13)
  • SaboniAmine (8)
  • mkbane (8)
  • dsblank (8)
  • stas00 (7)
  • kngoyal (6)
  • RafiullahOmar (6)
  • headscott (6)
  • pugantsov (4)
  • qxpBlog (4)
  • Lothiraldan (4)
  • Lucas-Otavio (3)
Pull Request Authors
  • benoit-cty (140)
  • inimaz (123)
  • prmths128 (66)
  • SaboniAmine (60)
  • dependabot[bot] (56)
  • vict0rsch (30)
  • Lothiraldan (20)
  • MyGodItsFull0fStars (19)
  • kngoyal (18)
  • LiamConnell (12)
  • LuisBlanche (11)
  • IamLRBA (10)
  • mathilde-leval (8)
  • alexphiev (7)
  • MarionCoutarel (7)
Top Labels
Issue Labels
enhancement (79) good first issue (52) bug (46) documentation (30) question (24) dataforgood (20) API (15) help wanted (14) P1 (7) P2 (6) wontfix (5) P3 (5) Dashboard (5) docs (4) security (4) invalid (1) duplicate (1) Expand contributors (1)
Pull Request Labels
dependencies (56) API (22) python (20) javascript (15) enhancement (12) bug (5) Dashboard (4) dataforgood (2) invalid (2) docs (1) good first issue (1) documentation (1) security (1)

Packages

  • Total packages: 6
  • Total downloads:
    • pypi 48,433 last-month
  • Total docker downloads: 430,060
  • Total dependent packages: 39
    (may contain duplicates)
  • Total dependent repositories: 807
    (may contain duplicates)
  • Total versions: 130
  • Total maintainers: 1
pypi.org: codecarbon
  • Versions: 57
  • Dependent Packages: 36
  • Dependent Repositories: 806
  • Downloads: 48,433 Last month
  • Docker Downloads: 430,060
Rankings
Dependent packages count: 0.4%
Dependent repos count: 0.4%
Average: 0.7%
Docker downloads count: 1.0%
Downloads: 1.2%
Maintainers (1)
Last synced: 7 months ago
proxy.golang.org: github.com/mlco2/codecarbon
  • Versions: 48
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
conda-forge.org: codecarbon

Emissions Tracker is a Python package for tracking the carbon emissions produced by various kinds of computer programs, from straightforward algorithms to deep neural networks. By taking into account your computing infrastructure, location, usage and running time, Emissions Tracker can provide an estimate of how much CO2 you produced, and give you some comparisons with common modes of transporation to give you an order of magnitude.

  • Versions: 7
  • Dependent Packages: 2
  • Dependent Repositories: 1
Rankings
Stargazers count: 15.7%
Forks count: 18.7%
Average: 19.5%
Dependent packages count: 19.6%
Dependent repos count: 24.1%
Last synced: 6 months ago
conda-forge.org: codecarbon-test

Emissions Tracker is a Python package for tracking the carbon emissions produced by various kinds of computer programs, from straightforward algorithms to deep neural networks. By taking into account your computing infrastructure, location, usage and running time, Emissions Tracker can provide an estimate of how much CO2 you produced, and give you some comparisons with common modes of transporation to give you an order of magnitude.

  • Versions: 6
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Stargazers count: 15.6%
Forks count: 19.2%
Average: 24.4%
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Last synced: 6 months ago
conda-forge.org: codecarbon-viz

Emissions Tracker is a Python package for tracking the carbon emissions produced by various kinds of computer programs, from straightforward algorithms to deep neural networks. By taking into account your computing infrastructure, location, usage and running time, Emissions Tracker can provide an estimate of how much CO2 you produced, and give you some comparisons with common modes of transporation to give you an order of magnitude.

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 15.6%
Forks count: 19.2%
Average: 30.0%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago
conda-forge.org: codecarbon-dev

Emissions Tracker is a Python package for tracking the carbon emissions produced by various kinds of computer programs, from straightforward algorithms to deep neural networks. By taking into account your computing infrastructure, location, usage and running time, Emissions Tracker can provide an estimate of how much CO2 you produced, and give you some comparisons with common modes of transporation to give you an order of magnitude.

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 15.6%
Forks count: 19.2%
Average: 30.0%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

carbonserver/docker/requirements-dev.txt pypi
  • alembic * development
  • fastapi * development
  • fastapi-pagination * development
  • psycopg2 * development
  • pydantic * development
  • requests * development
  • sqlalchemy * development
  • tox * development
  • uvicorn * development
carbonserver/requirements-dev.txt pypi
  • alembic * development
  • bcrypt * development
  • dependency-injector * development
  • fastapi * development
  • fastapi-pagination * development
  • psycopg2-binary * development
  • pydantic * development
  • python-dateutil * development
  • requests * development
  • sqlalchemy * development
  • tox * development
  • uvicorn * development
carbonserver/requirements.txt pypi
  • alembic *
  • bcrypt *
  • dependency-injector *
  • fastapi *
  • fastapi-pagination *
  • psycopg2-binary *
  • pydantic *
  • python-dateutil *
  • requests *
  • sqlalchemy *
  • tox *
  • uvicorn *
examples/requirements-examples.txt pypi
  • keras-tuner *
  • tensorflow *
  • torch ==1.8.1
  • torchvision *
requirements-dev.txt pypi
  • arrow * development
  • black * development
  • dash * development
  • dash_bootstrap_components * development
  • dataclasses * development
  • fire * development
  • flake8 * development
  • fuzzywuzzy * development
  • isort * development
  • mypy * development
  • pandas * development
  • psutil * development
  • py-cpuinfo * development
  • pynvml * development
  • requests * development
  • responses * development
  • sphinx * development
  • sphinx-rtd-theme * development
requirements-test.txt pypi
  • fuzzywuzzy * test
  • mock * test
  • numpy * test
  • psutil * test
  • pytest * test
  • requests-mock * test
  • responses * test
  • tox * test
.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • actions/setup-python v2 composite
  • postgres 12 docker
.github/workflows/package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • actions/upload-artifact v1 composite
.github/workflows/pre-commit.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
.github/workflows/release-drafter.yml actions
  • release-drafter/release-drafter v5.7.0 composite
act/Dockerfile docker
  • ubuntu 20.04 build
carbonserver/docker/Dockerfile docker
  • ubuntu 20.04 build
docker/Dockerfile docker
  • python 3.8 build
docker-compose.yml docker
  • dpage/pgadmin4 latest
  • postgres 12
dashboard/requirements-new.txt pypi
  • codecarbon >=2.0.0
  • dash >=2.2.0
  • dash_bootstrap_components *
  • plotly >=5.6.0
dashboard/requirements.txt pypi
  • codecarbon >=2.0.0
  • dash >=2.2.0
  • gunicorn *
  • plotly >=5.6.0
requirements.txt pypi
  • codecarbon >=2.0.0
  • dash >=2.2.0
  • dash_bootstrap_components *
  • plotly >=5.6.0
carbonserver/setup.py pypi
setup.py pypi