cofy-api 0.3.0__tar.gz → 0.3.2__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.
- {cofy_api-0.3.0 → cofy_api-0.3.2}/PKG-INFO +1 -1
- {cofy_api-0.3.0 → cofy_api-0.3.2}/pyproject.toml +1 -1
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/api/cofy_api.py +6 -1
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/members/sources/csv_source.py +2 -1
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/production/sources/energyID_production.py +0 -3
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy_api.egg-info/PKG-INFO +1 -1
- {cofy_api-0.3.0 → cofy_api-0.3.2}/LICENSE +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/README.md +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/setup.cfg +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/api/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/api/docs_router.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/api/module.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/api/token_auth.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/members/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/members/model.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/members/module.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/members/source.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/production/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/production/module.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/tariff/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/tariff/formats/kiwatt.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/tariff/module.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/tariff/sources/energy_cost.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/tariff/sources/entsoe_day_ahead.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/__init__.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/format.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/formats/csv.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/formats/json.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/model.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/module.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/timeseries/source.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/version.py +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy_api.egg-info/SOURCES.txt +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy_api.egg-info/dependency_links.txt +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy_api.egg-info/requires.txt +0 -0
- {cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy_api.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ authors = [
|
|
|
4
4
|
{ name="EnergyID", email = "info@energieid.be" },
|
|
5
5
|
{ name="Jorg" }
|
|
6
6
|
]
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "An open-source modular framework for ingesting, standardising, storing, and computing energy-related data."
|
|
9
9
|
license = "MIT"
|
|
10
10
|
readme = "README.md"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
|
-
from fastapi import FastAPI
|
|
3
|
+
from fastapi import FastAPI, Request
|
|
4
4
|
from fastapi.openapi.utils import get_openapi
|
|
5
|
+
from fastapi.responses import JSONResponse
|
|
5
6
|
|
|
6
7
|
from ..version import get_installed_version
|
|
7
8
|
from .docs_router import DocsRouter
|
|
@@ -22,6 +23,7 @@ class CofyApi(FastAPI):
|
|
|
22
23
|
super().__init__(**(DEFAULT_ARGS | kwargs))
|
|
23
24
|
self._modules: list[Module] = []
|
|
24
25
|
self.include_router(DocsRouter(self.openapi))
|
|
26
|
+
self.add_route("/health", self.health_check, methods=["GET"])
|
|
25
27
|
|
|
26
28
|
def openapi(self):
|
|
27
29
|
return get_openapi(
|
|
@@ -35,6 +37,9 @@ class CofyApi(FastAPI):
|
|
|
35
37
|
self._modules.append(module)
|
|
36
38
|
self.include_router(module)
|
|
37
39
|
|
|
40
|
+
def health_check(self, request: Request) -> JSONResponse:
|
|
41
|
+
return JSONResponse({"status": "ok"})
|
|
42
|
+
|
|
38
43
|
@property
|
|
39
44
|
def tags_metadata(self) -> list[dict[str, Any]]:
|
|
40
45
|
return [module.tag for module in self._modules]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import builtins
|
|
1
2
|
import csv
|
|
2
3
|
|
|
3
4
|
from ..model import Member
|
|
@@ -25,7 +26,7 @@ class MembersCSVSource(MemberSource[Member]):
|
|
|
25
26
|
def list(
|
|
26
27
|
self,
|
|
27
28
|
email: str | None = None,
|
|
28
|
-
) -> list[Member]:
|
|
29
|
+
) -> builtins.list[Member]:
|
|
29
30
|
if email is not None:
|
|
30
31
|
return [m for m in self.members if m.email == email]
|
|
31
32
|
return self.members
|
{cofy_api-0.3.0 → cofy_api-0.3.2}/src/cofy/modules/production/sources/energyID_production.py
RENAMED
|
@@ -34,9 +34,6 @@ class EnergyIDProduction(TimeseriesSource):
|
|
|
34
34
|
raise ValueError("Record ID must be provided")
|
|
35
35
|
|
|
36
36
|
self.headers = {"Authorization": f"apikey {api_key}"}
|
|
37
|
-
response = requests.get("https://api.energyid.eu/api/v1/members/me", headers=self.headers)
|
|
38
|
-
if response.status_code != 200:
|
|
39
|
-
raise ValueError("Invalid API key provided for EnergyIDProduction source.")
|
|
40
37
|
self.record_id = record_id
|
|
41
38
|
|
|
42
39
|
async def fetch_timeseries(
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|