greenfootprint is a lightweight Python tool that estimates the energy consumption and carbon footprint of any Python script. It helps developers measure the environmental impact of their code in terms of runtime, CPU usage, energy, and COβ emissions.
Author β thuve-codes β LinkedIn
- π Analyze energy and carbon usage of a Python script
- βοΈ Uses runtime and CPU time to estimate watt-hours
- π«οΈ Converts energy usage to estimated COβ grams
- π Simple CLI with clean output
- π§ Tips to improve efficiency (coming soon)
pip install greenfootprint
greenfootprint examples\example_script.pyπ Running analysis on: examples/example_script.py
π Analysis Report for examples/example_script.py β±οΈ Runtime: 2.37 seconds π§ CPU Time: 2.10 seconds π Energy Used: 0.0088 kWh π«οΈ COβ Emitted: 4.16 grams
β Your code is moderately green!