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

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenfootprint-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b00779dfece9f7cf05eb03eabcea309cc3d06afd08268c3a0c51fc7a0e587d08
MD5 7e1a4dddf9749777a0076c635689d2e5
BLAKE2b-256 f5d4406798dfadb7ab9f9e8ad9fd3e74154622544cd01c0b31b85338ac609c5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greenfootprint-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 436126498dc9bd9211299a776cd352df87ba5a5cb05be7ec3c0162f43a893125
MD5 73c42f8002753228ce32301239c7e10a
BLAKE2b-256 2d9fd5c2eccd1fc085c4d7f4ab659349edf4a008dbc56dde915571e5a417ead7

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