Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Mares maresb

View GitHub Profile
View set_foreign_keys.py
from typing import Dict, List, Union
from sqlalchemy import Column
from sqlalchemy.orm import (
ColumnProperty,
InstrumentedAttribute,
MapperProperty,
RelationshipProperty,
)
from sqlmodel.main import SQLModelMetaclass
@maresb
maresb / managed_temporary_credentials_provider.py
Last active Dec 16, 2020
Make boto3 automatically check the shared credentials file for updates.
View managed_temporary_credentials_provider.py
"""Make boto3 automatically check the shared credentials file for updates.
In some situations, the ~/.aws/credentials file may be periodically updated. For
example, this is the case with the "AWS managed temporary credentials" which are
provided to AWS Cloud9 environments. (See
<https://docs.aws.amazon.com/cloud9/latest/user-guide/how-cloud9-with-iam.html#auth-and-access-control-temporary-managed-credentials>.)
Example usage of this module is:
import boto3