Skip to content

Instantly share code, notes, and snippets.

@Tarliton
Tarliton / async_sqlalchemy_thread.py
Last active February 26, 2023 13:07
asyncio with a thread executor and sqlalchemy
import asyncio
import base64
import os
import random
from sqlalchemy import Column, Integer, String
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker, declarative_base
# SQLAlchemy==2.0.4
@tylerjw
tylerjw / cachedgeo.py
Last active March 24, 2024 17:49
Library for caching requests to Nominatim in AWS DynamoDB
import boto3
from botocore.exceptions import ClientError
import decimal
from putItem import addr_to_query, query_to_addr
from geopy.geocoders import Nominatim
import json
import logging
logger = logging.getLogger(__name__)
@jasonrdsouza
jasonrdsouza / combineS3Files.py
Last active June 3, 2023 17:22
Python script to efficiently concatenate S3 files
'''
This script performs efficient concatenation of files stored in S3. Given a
folder, output location, and optional suffix, all files with the given suffix
will be concatenated into one file stored in the output location.
Concatenation is performed within S3 when possible, falling back to local
operations when necessary.
Run `python combineS3Files.py -h` for more info.
'''