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.2.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.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file greenfootprint-0.1.2.tar.gz.

File metadata

  • Download URL: greenfootprint-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 02d766d5edc334e8ebf923f56ab7147ffba9d169f9c31b707b7657dddb04a78a
MD5 28991471eaba4b3b22ea9e605f1c0669
BLAKE2b-256 964e843c77f02f895c145b28f04e49241248f118fe7f9d4a7c2285ad96da5810

See more details on using hashes here.

File details

Details for the file greenfootprint-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: greenfootprint-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34df8177e6c98b98b466a711ecf6e0498473845c22696ed5aeac538c0c131cc1
MD5 0909bb4a93af7539968d94a2eca5b108
BLAKE2b-256 1bad0ad46313f364499ed36edd9ce588d8562eeb7cfd2eb667abc4395cc3e44c

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