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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenfootprint-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 55cb3c699268651d5c1675458c599ab5e357365ca144a99f55ff78883563dcc1
MD5 de7bdea34d64a35b795115b779cc3e66
BLAKE2b-256 5cd6b605e178ae9aa92c510ba1cd4d888ab2e4cd69c24e2544561461b3d5ee32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greenfootprint-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbf106614dd043b25d3c59841d7191acef112af6d4f0a5699cc6c91651a951d1
MD5 b1e51ae08e14d9af7dee06d75d883684
BLAKE2b-256 814acece0d7e4fa5aa2762aaf0ad4567b8d56af0bfbf5741369042fc642354af

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