MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / fetch_last_half_hour

Function fetch_last_half_hour

web_programming/co2_emission.py:20–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19# Emission in the last half hour
20def fetch_last_half_hour() -> str:
21 last_half_hour = httpx.get(BASE_URL, timeout=10).json()["data"][0]
22 return last_half_hour["intensity"]["actual"]
23
24
25# Emissions in a specific date range

Callers 1

co2_emission.pyFile · 0.85

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected