Skip to main content

EcoTrace: High-precision carbon tracking engine for production Python. Function-level CPU/GPU emission measurement with 50ms continuous sampling, Boavizta TDP database, and audit-ready PDF reporting.

Project description

EcoTrace Logo

EcoTrace

High-Precision Energy and Emissions Instrumentation


v0.9.0 is now live! Includes high-precision hybrid energy tracking (RAPL + Boavizta).

EcoTrace is a lightweight library for granular carbon footprint measurement of Python applications. No configuration files, no background services—just real-time hardware-level transparency.

Real-time monitoring · 50+ Global Zones · AI-powered insights · Zero-configuration


PyPI - Version Python 3.9+ License: MIT Downloads VS Code Extension


[!TIP] VS Code Extension: Monitor application carbon footprint in real-time during development. Download here.


EcoTrace Demo

Function-level carbon measurement with real-time monitoring


Quick Install

pip install ecotrace

Quick Start

Option 1: Zero-Code Profiling (CLI)

Measure any script without changing a single line of code:

ecotrace run my_script.py

Option 2: Programmatic Tracking (Library)

Decorate functions for granular instrumentation:

from ecotrace import EcoTrace

# region_code: Use ISO 3166-1 alpha-2 (e.g., US, TR, DE). See docs/SUPPORT.md for full list.
eco = EcoTrace(region_code="US")

@eco.track
def my_function():
    # Your heavy processing here
    pass

my_function()

# Export audit-ready reports or check cumulative totals
eco.generate_pdf_report("carbon_audit.pdf")
print(f"Total Carbon Emitted: {eco.total_carbon} gCO2")

Expected Output

When initialized, EcoTrace performs automated hardware detection:

---------------------------------
--- EcoTrace v0.8.0 Initialized ---
Region  : US (367 gCO2/kWh)
CPU     : 13th Gen Intel Core i9-13900K
TDP     : 125.0W
Monitoring: Active (50ms sampling)
---------------------------------

Why EcoTrace?

Feature EcoTrace CodeCarbon CarbonTracker
Sampling Interval 50ms 15s Per Epoch
Isolation Process-scoped System-wide System-wide
Dependencies Zero (Core) 10+ (Pandas, etc.) 5+
Async Support Native Limited No
  • Deep Transparency: Derived from verified manufacturer TDP specifications rather than category averages.
  • Fail-Safe Architecture: Guaranteed application continuity even if hardware drivers or API keys are missing.
  • Actionable AI: Integrates with Google Gemini to provide specific code optimization advice (optional).

Documentation


Contributing

We welcome contributions! Please see our CONTRIBUTING.MD for guidelines on reporting bugs, suggesting features, or contributing hardware data.


Community

Join Discord

CHANGELOG.md · SECURITY.MD


Author and License

Emre OzkalGitHub · ecotraceteam@gmail.com

MIT License — Use it however you like.

Developed for sustainable software development practices.

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

ecotrace-0.9.0.tar.gz (407.5 kB view details)

Uploaded Source

Built Distribution

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

ecotrace-0.9.0-py3-none-any.whl (424.5 kB view details)

Uploaded Python 3

File details

Details for the file ecotrace-0.9.0.tar.gz.

File metadata

  • Download URL: ecotrace-0.9.0.tar.gz
  • Upload date:
  • Size: 407.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for ecotrace-0.9.0.tar.gz
Algorithm Hash digest
SHA256 13e0681a278c840604e24be01c8277ca9a44871cc3e6904eae94765f79588f22
MD5 6d5cc3b41fe9408c52141ed92d776fc7
BLAKE2b-256 6b52bd3742548f21902f523bb5c9737261439ba780644f47882bbd0c5dc5452d

See more details on using hashes here.

File details

Details for the file ecotrace-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: ecotrace-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 424.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for ecotrace-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f8b8ffca10b17e5c4272a1db6f0b1ad6ec866ca9c2002e83305b10a3d949c4b
MD5 c7780ade624501e9beb548fb9a98562c
BLAKE2b-256 dfecad4c27930410c875c5f23d4137ae9d1af2353baa94c71e7911c4b9c8cbb7

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