Skip to content

Instantly share code, notes, and snippets.

@bl4ckst0ne
bl4ckst0ne / rest_client.py
Created November 3, 2020 09:44
Generic REST API client
from functools import partialmethod
from typing import Union, Dict, List, Any
import requests
JSONType = Union[None, bool, int, float, str, List[Any], Dict[str, Any]]
class RestError(Exception):
"""
@pucbabajob
pucbabajob / rds-lambda-s3.py
Last active October 19, 2025 01:28
Query RDS from lambda and save the result as CSV, Sent the result in Email, Save the Result in S3
# Query RDS From Lambda and Send Results in Email and Save it to S3
# Blog Post: https://blog.powerupcloud.com/automate-rds-and-aurora-mysql-processes-list-in-lambda-with-kms-736b2878349
# Verson 1.1
# Bug fix1 : Mulitple email receipts
import sys
import logging
import pymysql
import os