Skip to main content

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

Authorthuve-codesLinkedIn


📦 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

greenfootprint-0.1.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

greenfootprint-0.1.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for greenfootprint-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a57290b571a03449943520080307048a7093cd2ef8e758ce6d71a972795f9d25
MD5 054bcf743619a9dc696bb3598fb73728
BLAKE2b-256 87aa11f24e1814dd8773e6148c3e16d8904c3ff1e755afac186341688568a130

See more details on using hashes here.

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

Hashes for greenfootprint-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 daaf2c380c4d5abd63e6908d9e5214897d759341ae39deb2e77ae9ef77de18cf
MD5 3a7229f06e24bd140ed4837af7630152
BLAKE2b-256 68c139c3ffea123361bf9212265fd0ff869a2ab371b2eca2d37013c4839982cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page