tracarbon 0.7.2__tar.gz → 0.7.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tracarbon-0.7.2 → tracarbon-0.7.4}/PKG-INFO +9 -8
- {tracarbon-0.7.2 → tracarbon-0.7.4}/pyproject.toml +22 -22
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/rapl.py +3 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/sensors.py +1 -1
- {tracarbon-0.7.2 → tracarbon-0.7.4}/LICENSE.txt +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/README.md +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/__main__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/builder.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/cli/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/conf.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/emissions/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/emissions/carbon_emissions.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exceptions.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/datadog_exporter.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/exporter.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/json_exporter.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/prometheus_exporter.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/exporters/stdout.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/general_metrics.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/cloud_providers.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/containers.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/data/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/data/aws-instances.csv +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/energy.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/gpu.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/hardwares/hardware.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/country.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/data/__init__.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/data/co2-emission-intensity-9.exhibit.json +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/data/grid-emissions-factors-aws.csv +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/location.py +0 -0
- {tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tracarbon
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: Tracarbon is a Python library that tracks your device's energy consumption and calculates your carbon emissions.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: energy,sustainability,energy-consumption,electricity-consumption,energy-efficiency,carbon-footprint,carbon-emissions
|
|
@@ -15,24 +15,25 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
20
|
Provides-Extra: datadog
|
|
20
21
|
Provides-Extra: kubernetes
|
|
21
22
|
Provides-Extra: prometheus
|
|
22
23
|
Requires-Dist: aiocache (>=0.12.1,<0.13.0)
|
|
23
|
-
Requires-Dist: aiofiles (>=23.2
|
|
24
|
+
Requires-Dist: aiofiles (>=23.2,<25.0)
|
|
24
25
|
Requires-Dist: aiohttp (>=3.9.3,<4.0.0)
|
|
25
|
-
Requires-Dist: asyncer (>=0.0.5,<0.0.
|
|
26
|
-
Requires-Dist: datadog (>=0.44,<0.
|
|
26
|
+
Requires-Dist: asyncer (>=0.0.5,<0.0.9)
|
|
27
|
+
Requires-Dist: datadog (>=0.44,<0.51) ; extra == "datadog"
|
|
27
28
|
Requires-Dist: ec2-metadata (>=2.13.0,<3.0.0)
|
|
28
|
-
Requires-Dist: kubernetes (>=26.1,<
|
|
29
|
+
Requires-Dist: kubernetes (>=26.1,<32.0) ; extra == "kubernetes"
|
|
29
30
|
Requires-Dist: loguru (>=0.6,<0.8)
|
|
30
31
|
Requires-Dist: msgpack (>=1.0.4,<2.0.0)
|
|
31
|
-
Requires-Dist: prometheus-client (>=0.16,<0.
|
|
32
|
-
Requires-Dist: psutil (>=5.9.8
|
|
32
|
+
Requires-Dist: prometheus-client (>=0.16,<0.22) ; extra == "prometheus"
|
|
33
|
+
Requires-Dist: psutil (>=5.9.8)
|
|
33
34
|
Requires-Dist: pydantic (>=1.10.7,<3.0.0)
|
|
34
35
|
Requires-Dist: python-dotenv (>=0.21,<1.1)
|
|
35
|
-
Requires-Dist: typer (>=0.7,<0.
|
|
36
|
+
Requires-Dist: typer (>=0.7,<0.16)
|
|
36
37
|
Requires-Dist: ujson (>=5.9.0,<6.0.0)
|
|
37
38
|
Description-Content-Type: text/markdown
|
|
38
39
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "tracarbon"
|
|
3
3
|
authors = ["Florian Valeye <fvaleye@github.com>"]
|
|
4
|
-
version = "0.7.
|
|
4
|
+
version = "0.7.4"
|
|
5
5
|
description = "Tracarbon is a Python library that tracks your device's energy consumption and calculates your carbon emissions."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
license = "Apache-2.0"
|
|
@@ -18,40 +18,40 @@ python = "^3.8"
|
|
|
18
18
|
loguru = ">=0.6,<0.8"
|
|
19
19
|
aiohttp = "^3.9.3"
|
|
20
20
|
aiocache = "^0.12.1"
|
|
21
|
-
aiofiles = "
|
|
22
|
-
psutil = "
|
|
21
|
+
aiofiles = ">=23.2,<25.0"
|
|
22
|
+
psutil = ">=5.9.8"
|
|
23
23
|
ujson = "^5.9.0"
|
|
24
24
|
msgpack = "^1.0.4"
|
|
25
25
|
pydantic = ">=1.10.7,<3.0.0"
|
|
26
|
-
typer = ">=0.7,<0.
|
|
26
|
+
typer = ">=0.7,<0.16"
|
|
27
27
|
ec2-metadata = "^2.13.0"
|
|
28
28
|
python-dotenv = ">=0.21,<1.1"
|
|
29
|
-
asyncer = "
|
|
30
|
-
datadog = {version = ">=0.44,<0.
|
|
31
|
-
prometheus-client = {version = ">=0.16,<0.
|
|
32
|
-
kubernetes = {version = ">=26.1,<
|
|
29
|
+
asyncer = ">=0.0.5,<0.0.9"
|
|
30
|
+
datadog = {version = ">=0.44,<0.51", optional = true}
|
|
31
|
+
prometheus-client = {version = ">=0.16,<0.22", optional = true}
|
|
32
|
+
kubernetes = {version = ">=26.1,<32.0", optional = true}
|
|
33
33
|
|
|
34
34
|
[tool.poetry.dev-dependencies]
|
|
35
|
-
mypy = "^1.
|
|
36
|
-
ruff = "^0.
|
|
37
|
-
pytest = "^8.
|
|
38
|
-
pytest-mock = "^3.
|
|
39
|
-
pytest-asyncio = "^0.
|
|
40
|
-
pytest-cov = "^
|
|
41
|
-
pytest-xdist = "^3.
|
|
35
|
+
mypy = "^1.10"
|
|
36
|
+
ruff = "^0.8.5"
|
|
37
|
+
pytest = "^8.2.1"
|
|
38
|
+
pytest-mock = "^3.14.0"
|
|
39
|
+
pytest-asyncio = "^0.24.0"
|
|
40
|
+
pytest-cov = "^5.0.0"
|
|
41
|
+
pytest-xdist = "^3.6.1"
|
|
42
42
|
pytest-clarity = "^1.0.1"
|
|
43
43
|
sphinx = "^7.1.2"
|
|
44
44
|
pydata-sphinx-theme = "^0.14.4"
|
|
45
45
|
toml = "^0.10.2"
|
|
46
|
-
types-ujson = "^5.
|
|
47
|
-
datadog = ">=0.44,<0.
|
|
48
|
-
prometheus-client = ">=0.16,<0.
|
|
46
|
+
types-ujson = "^5.10.0"
|
|
47
|
+
datadog = ">=0.44,<0.51"
|
|
48
|
+
prometheus-client = ">=0.16,<0.22"
|
|
49
49
|
types-requests = "^2.31.0"
|
|
50
|
-
bandit = "^1.7.
|
|
50
|
+
bandit = "^1.7.9"
|
|
51
51
|
radon = "^6.0.1"
|
|
52
|
-
types-aiofiles = "^
|
|
53
|
-
kubernetes = ">=26.1,<
|
|
54
|
-
autodoc_pydantic = "1.9.
|
|
52
|
+
types-aiofiles = "^24.1.0"
|
|
53
|
+
kubernetes = ">=26.1,<32.0"
|
|
54
|
+
autodoc_pydantic = "1.9.1"
|
|
55
55
|
|
|
56
56
|
[tool.poetry.extras]
|
|
57
57
|
datadog = ["datadog"]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from typing import Dict
|
|
5
6
|
from typing import List
|
|
6
7
|
from typing import Optional
|
|
@@ -76,8 +77,10 @@ class RAPL(BaseModel):
|
|
|
76
77
|
if not self.file_list:
|
|
77
78
|
self.get_rapl_files_list()
|
|
78
79
|
for file_path in self.file_list:
|
|
80
|
+
name_prefix = Path(file_path).name.replace("intel-rapl", "")
|
|
79
81
|
async with aiofiles.open(f"{file_path}/name", "r") as rapl_name:
|
|
80
82
|
name = await rapl_name.read()
|
|
83
|
+
name = f"{name_prefix}-{name}"
|
|
81
84
|
async with aiofiles.open(f"{file_path}/energy_uj", "r") as rapl_energy:
|
|
82
85
|
energy_uj = float(await rapl_energy.read())
|
|
83
86
|
async with aiofiles.open(f"{file_path}/max_energy_range_uj", "r") as rapl_max_energy:
|
|
@@ -81,7 +81,7 @@ class MacEnergyConsumption(EnergyConsumption):
|
|
|
81
81
|
Energy Consumption of the Mac, working only if it's plugged into plugged-in wall adapter, in watts.
|
|
82
82
|
"""
|
|
83
83
|
|
|
84
|
-
shell_command: str = """
|
|
84
|
+
shell_command: str = """ioreg -rw0 -a -c AppleSmartBattery | plutil -extract '0.BatteryData.AdapterPower' raw -"""
|
|
85
85
|
|
|
86
86
|
async def get_energy_usage(self) -> EnergyUsage:
|
|
87
87
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tracarbon-0.7.2 → tracarbon-0.7.4}/tracarbon/locations/data/co2-emission-intensity-9.exhibit.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|