Estimate energy and carbon footprint of Python scripts
Project description
🌱 greenfootprint
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.
🙋 About the Author
Author – thuve-codes – LinkedIn
📦 Features
- 🔍 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)
🛠️ Installation & RUN
pip install greenfootprint
greenfootprint examples\example_script.py
Sample Output
🔍 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!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file greenfootprint-0.1.4.tar.gz.
File metadata
- Download URL: greenfootprint-0.1.4.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a57290b571a03449943520080307048a7093cd2ef8e758ce6d71a972795f9d25
|
|
| MD5 |
054bcf743619a9dc696bb3598fb73728
|
|
| BLAKE2b-256 |
87aa11f24e1814dd8773e6148c3e16d8904c3ff1e755afac186341688568a130
|
File details
Details for the file greenfootprint-0.1.4-py3-none-any.whl.
File metadata
- Download URL: greenfootprint-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daaf2c380c4d5abd63e6908d9e5214897d759341ae39deb2e77ae9ef77de18cf
|
|
| MD5 |
3a7229f06e24bd140ed4837af7630152
|
|
| BLAKE2b-256 |
68c139c3ffea123361bf9212265fd0ff869a2ab371b2eca2d37013c4839982cf
|