-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoint for creating new Sheet-s with the ad and keywords data imple…
…mented (#33) * wip * wip * wip * process-data endpoint implemented * Updated get-sheet endpoint to return pydantic GoogleSheetValues object * process-spreadsheet endpoint implemented * Refactoring * Tests updated * wip * Rename validate_data to validate_input_data * Update process_data_f function to return DataFrame * wip _validate_output_data_ad * wip * Update ads dataframe validation * .devcontainer added * Update missing FastAPI endpoint/query descriptions * Uncomment postgres port forwarding in the devcontainer docker-compose files --------- Co-authored-by: Davor Runje <[email protected]>
- Loading branch information
1 parent
1a37abf
commit 2f05ece
Showing
17 changed files
with
1,693 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
PORT_PREFIX=${PORT_PREFIX} | ||
CONTAINER_PREFIX=${USER} | ||
|
||
GOOGLE_SHEETS_CLIENT_SECRET=${GOOGLE_SHEETS_CLIENT_SECRET} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "python-3.10", | ||
"dockerComposeFile": [ | ||
"./docker-compose.yml" | ||
], | ||
"service": "python-3.10", | ||
"forwardPorts": [], | ||
"shutdownAction": "stopCompose", | ||
"workspaceFolder": "/workspaces/google-sheets", | ||
"remoteEnv": {}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"installOhMyZsh": true, | ||
"configureZshAsDefaultShell": true, | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": true | ||
}, | ||
"ghcr.io/devcontainers/features/git-lfs:1": {}, | ||
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} | ||
}, | ||
"updateContentCommand": "bash .devcontainer/setup.sh", | ||
"postCreateCommand": [], | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.linting.enabled": true, | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "always" | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.vscode-pylance" | ||
}, | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.vscode-jupyter-cell-tags", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.vscode-jupyter-slideshow", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
|
||
services: | ||
python-3.10: # nosemgrep | ||
image: mcr.microsoft.com/devcontainers/python:3.10 | ||
container_name: $USER-python-3.10-google-sheets | ||
volumes: | ||
- ../../:/workspaces/google-sheets:cached | ||
command: sleep infinity | ||
environment: | ||
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets | ||
env_file: | ||
- ../devcontainer.env | ||
networks: | ||
- google-sheets-network | ||
postgres-google-sheets: # nosemgrep | ||
image: postgres:latest | ||
container_name: $USER-postgres-py39-google-sheets | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: password # pragma: allowlist secret | ||
POSTGRES_DB: google-sheets | ||
ports: | ||
- "${PORT_PREFIX}5432:5432" | ||
networks: | ||
- google-sheets-network | ||
|
||
networks: | ||
google-sheets-network: | ||
name: "${USER}-google-sheets-network" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "python-3.11", | ||
"dockerComposeFile": [ | ||
"./docker-compose.yml" | ||
], | ||
"service": "python-3.11", | ||
"forwardPorts": [], | ||
"shutdownAction": "stopCompose", | ||
"workspaceFolder": "/workspaces/google-sheets", | ||
"remoteEnv": {}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"installOhMyZsh": true, | ||
"configureZshAsDefaultShell": true, | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": true | ||
}, | ||
"ghcr.io/devcontainers/features/git-lfs:1": {}, | ||
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} | ||
}, | ||
"updateContentCommand": "bash .devcontainer/setup.sh", | ||
"postCreateCommand": [], | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.linting.enabled": true, | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "always" | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.vscode-pylance" | ||
}, | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.vscode-jupyter-cell-tags", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.vscode-jupyter-slideshow", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
|
||
services: | ||
python-3.11: # nosemgrep | ||
image: mcr.microsoft.com/devcontainers/python:3.11 | ||
container_name: $USER-python-3.11-google-sheets | ||
volumes: | ||
- ../../:/workspaces/google-sheets:cached | ||
command: sleep infinity | ||
environment: | ||
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets | ||
env_file: | ||
- ../devcontainer.env | ||
networks: | ||
- google-sheets-network | ||
postgres-google-sheets: # nosemgrep | ||
image: postgres:latest | ||
container_name: $USER-postgres-py39-google-sheets | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: password # pragma: allowlist secret | ||
POSTGRES_DB: google-sheets | ||
ports: | ||
- "${PORT_PREFIX}5432:5432" | ||
networks: | ||
- google-sheets-network | ||
|
||
networks: | ||
google-sheets-network: | ||
name: "${USER}-google-sheets-network" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "python-3.12", | ||
"dockerComposeFile": [ | ||
"./docker-compose.yml" | ||
], | ||
"service": "python-3.12", | ||
"forwardPorts": [], | ||
"shutdownAction": "stopCompose", | ||
"workspaceFolder": "/workspaces/google-sheets", | ||
"remoteEnv": {}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"installOhMyZsh": true, | ||
"configureZshAsDefaultShell": true, | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": true | ||
}, | ||
"ghcr.io/devcontainers/features/git-lfs:1": {}, | ||
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} | ||
}, | ||
"updateContentCommand": "bash .devcontainer/setup.sh", | ||
"postCreateCommand": [], | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.linting.enabled": true, | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "always" | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.vscode-pylance" | ||
}, | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.vscode-jupyter-cell-tags", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.vscode-jupyter-slideshow", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
|
||
services: | ||
python-3.12: # nosemgrep | ||
image: mcr.microsoft.com/devcontainers/python:3.12 | ||
container_name: $USER-python-3.12-google-sheets | ||
volumes: | ||
- ../../:/workspaces/google-sheets:cached | ||
command: sleep infinity | ||
environment: | ||
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets | ||
env_file: | ||
- ../devcontainer.env | ||
networks: | ||
- google-sheets-network | ||
postgres-google-sheets: # nosemgrep | ||
image: postgres:latest | ||
container_name: $USER-postgres-py39-google-sheets | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: password # pragma: allowlist secret | ||
POSTGRES_DB: google-sheets | ||
ports: | ||
- "${PORT_PREFIX}5432:5432" | ||
networks: | ||
- google-sheets-network | ||
|
||
networks: | ||
google-sheets-network: | ||
name: "${USER}-google-sheets-network" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "python-3.9", | ||
"dockerComposeFile": [ | ||
"./docker-compose.yml" | ||
], | ||
"service": "python-3.9", | ||
"forwardPorts": [], | ||
"shutdownAction": "stopCompose", | ||
"workspaceFolder": "/workspaces/google-sheets", | ||
"remoteEnv": {}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"installOhMyZsh": true, | ||
"configureZshAsDefaultShell": true, | ||
"username": "vscode", | ||
"userUid": "1000", | ||
"userGid": "1000" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": true | ||
}, | ||
"ghcr.io/devcontainers/features/git-lfs:1": {}, | ||
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} | ||
}, | ||
"updateContentCommand": "bash .devcontainer/setup.sh", | ||
"postCreateCommand": [], | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.linting.enabled": true, | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "always" | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.vscode-pylance" | ||
}, | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.vscode-jupyter-cell-tags", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-toolsai.vscode-jupyter-slideshow", | ||
"ms-python.vscode-pylance" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
|
||
services: | ||
python-3.9: # nosemgrep | ||
image: mcr.microsoft.com/devcontainers/python:3.9 | ||
container_name: $USER-python-3.9-google-sheets | ||
volumes: | ||
- ../../:/workspaces/google-sheets:cached | ||
command: sleep infinity | ||
environment: | ||
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets | ||
env_file: | ||
- ../devcontainer.env | ||
networks: | ||
- google-sheets-network | ||
postgres-google-sheets: # nosemgrep | ||
image: postgres:latest | ||
container_name: $USER-postgres-py39-google-sheets | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: password # pragma: allowlist secret | ||
POSTGRES_DB: google-sheets | ||
ports: | ||
- "${PORT_PREFIX}5432:5432" | ||
networks: | ||
- google-sheets-network | ||
|
||
networks: | ||
google-sheets-network: | ||
name: "${USER}-google-sheets-network" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# update pip | ||
pip install --upgrade pip | ||
|
||
# install dev packages | ||
pip install -e ".[dev]" | ||
|
||
# install pre-commit hook if not installed already | ||
pre-commit install | ||
|
||
prisma migrate deploy | ||
prisma generate | ||
|
||
echo '{ | ||
"web": { | ||
"client_id": "1027914582771-g0bcsn4fhd6a59pp3d4n1ntjc03r1k9s.apps.googleusercontent.com", | ||
"project_id": "captn-sheets-dev", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_secret": "'${GOOGLE_SHEETS_CLIENT_SECRET}'", | ||
"redirect_uris": [ | ||
"http://localhost:8000/login/callback" | ||
] | ||
} | ||
}' > client_secret.json |
Oops, something went wrong.