-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (24 loc) · 718 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (24 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from pandas.core.frame import DataFrame
from implementations import GCPClient
from interfaces import (
PlatformClient,
DataTransform
)
from dotenv import load_dotenv
import os
def get_data(client: PlatformClient, query: str) -> DataFrame:
return client.get_platform_data(query=query)
def transform_data(client: DataTransform, df: DataFrame) -> DataFrame:
return client.transform_data(df=df)
def main() -> None:
load_dotenv()
SA_FILE = os.environ["GCP_FILE"]
QUERY = os.environ["GCP_QUERY"]
clients = []
clients.append(GCPClient(service_account_file=SA_FILE))
df = None
for client in clients:
df = get_data(client, QUERY)
transformed_df = transform_data(client, df)
if __name__=="__main__":
main()