Skip to content

OurCreativity/greenkode

Repository files navigation

🌿 GreenKode

Sustainable Software Engineering for a World of 8 Billion

License Python Carbon Neutral Competition


"The greenest energy is the energy we don't use."

GreenKode is a professional CLI tool that empowers developers to measure, analyze, and optimize the carbon footprint of their code. By bridging the gap between hardware sensors and high-level Python, we make sustainability a core part of the development lifecycle.


🚀 Features at a Glance

Feature Description Tech Stack
🔍 Static Scan Detects inefficient patterns (e.g., O(n²) loops) before execution. ast, typer
⚡ Live Audit Measures real-time CPU energy usage and CO2 emissions. codecarbon, Intel RAPL
📊 Rich Dashboard Professional terminal UI with "Eco-Grades" (A+ to F). rich
🌍 Universal CLI Single command access for any Python script. pip, poetry

📦 Quick Start

1. Installation

pip install greenkode

(Requires codecarbon, rich, typer)

2. Usage

Option A: Static Analysis (Pre-Flight Check) Instantly find bad code patterns without running the script.

greenkode check my_script.py

Option B: Live Energy Audit (Flight Recorder) Run your script and see the energy cost.

greenkode run my_script.py

3. Help

greenkode --help

🔬 The Science Behind GreenKode

GreenKode leverages Intel RAPL (Running Average Power Limit) sensors to measure the exact energy consumption of the CPU in joules.

  1. Measurement: We track the power draw of the specific process ID (PID).
  2. Conversion: Joules are converted to kWh.
  3. Carbon Intensity: We apply the local grid's carbon intensity factor (gCO2/kWh) to calculate the final carbon footprint.

👤 Author & Competition Context

Created by: Ardellio Satria Anindito
Location: Bandung, Jawa Barat, Indonesia 🇮🇩
Competition: World of 8 Billion (Energy & Climate Change)

📚 Documentation / Dokumentasi

We have comprehensive documentation for users, developers, and judges:

🏁 For Users

🧠 For Developers & Judges


Built with ❤️ for a greener planet.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors