boto3 # aws sdk
requests # to download dynamodb
mirakuru # monitors the subprocess and checks for an open port
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 flask import Flask | |
from flask.json import JSONEncoder | |
class EnhancedJSONEncoder(JSONEncoder): | |
def default(self, o): | |
if dataclasses.is_dataclass(o): | |
return dataclasses.asdict(o) | |
return super().default(o) |
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
# Timer for functions | |
from functools import wraps | |
def timeit(f): | |
@wraps(f) | |
def wrap(*args, **kwargs): | |
start = time() | |
r = f(*args, **kwargs) | |
print(f.__name__, time() - start) |
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
""" | |
Configures a logger to log <=INFO to stdout and >INFO to stderr | |
""" | |
import logging | |
import os | |
import sys | |
DEFAULT_FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %(message)s' | |
NO_TIME_FORMAT = '%(levelname)s - %(name)s - %(message)s' |
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 threading import Thread | |
import pytest | |
import requests | |
from flask import Flask | |
@pytest.fixture() | |
def app() -> Flask: | |
host = 'localhost' |
OlderNewer