Skip to content

Instantly share code, notes, and snippets.

@bbengfort
bbengfort / balance.py
Created December 7, 2017 02:11
Database transactions blog post.
#!/usr/bin/env python3
import os
import logging
import psycopg2 as pg
from decimal import Decimal
from functools import wraps
from psycopg2.pool import ThreadedConnectionPool
@brettfreer
brettfreer / dynamodb_rename_attribute.py
Last active November 10, 2023 00:43
Rename an AWS dynamodb table attribute with an exponential timing backoff
#!/usr/bin/env python3
""" Rename an AWS dynamodb table attribute with an exponential timing back-off
"""
import logging
from time import sleep
import boto3
from boto3.dynamodb.conditions import Attr