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
""" | |
Based off Stripe's checkout repo, see the link for the Flask analogue. | |
https://github.com/stripe-samples/checkout-one-time-payments/blob/master/server/python/server.py | |
Assumes project is structured like: | |
src/ | |
backend/ | |
app.py |
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
import re | |
from typing import Dict | |
from io import StringIO | |
from dateutil import parser | |
from sqlalchemy import create_engine | |
import pandas as pd | |
def is_date(string): | |
if string.isnumeric(): |
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
from src.app.db.base import Base as AppBase # noqa | |
from src.b2b.db.base import Base as B2BBase # noqa | |
target_metadata = MetaData() | |
for table in AppBase.metadata.tables.values(): | |
table.tometadata(target_metadata) | |
for table in B2BBase.metadata.tables.values(): | |
table.tometadata(target_metadata) |
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
""" | |
Much of this was borrowed from: | |
https://github.com/Tert0/fastapi-framework/blob/develop/fastapi_framework/redis.py | |
Assumes redis = "^4.5.1" | |
Meant to be used like this: | |
@app.on_event("startup") | |
async def on_startup(): |