\flushright
My Street Address My City, MY STATE my zip code (My) Phone-Number
''' | |
Proof of Concept: | |
Django devs built an ORM that seems way more straightforward than many existing tools. This class lets you leverage the django-orm without any project settings or other aspects of a django setup. | |
There are probably weak points and functionality missing, but it seems like a relatively intuitive proof of concept | |
''' | |
import os | |
import django | |
from django.conf import settings |
''' | |
Built with chatgpt; still in the process of testing | |
''' | |
import time | |
import pandas as pd | |
from sqlalchemy import create_engine, Table, MetaData, select, insert, update, bindparam | |
def upsert_dataframe_to_sql(dataframe, table_name, id_column="id", verbose=True): | |
""" | |
Upsert a Pandas DataFrame into a SQL table using SQLAlchemy. |
''' | |
Build with the help of chatgpt | |
''' | |
import openai | |
openai.api_key = 'your_api_key_here' | |
def response(message): | |
retry_count = 0 | |
max_retries = 4 | |
wait_time = 7 # Initial wait time in seconds |
''' | |
Name: Distilled (since it's sqlalchemy with the parts a normal person cares about distilled from the rest in one Database class) | |
Very basic wrapper around the sqlalchemy orm that tries to replicate the ease of use that you get with r's dbplyr. Namely: | |
- provide the database connection details (in this case ones that are stored in a config file) | |
- return a single object from which you can do everything you need to | |
Similar in spirit to the more developed library: [dataset](https://dataset.readthedocs.io/en/latest/install.html) | |
Rewrote an old version of this with help from chatgpt |
#!/usr/local/bin/python3 | |
''' | |
This site is very useful for regex testing: https://pythex.org/ | |
''' | |
import re, argparse | |
args = argparse.ArgumentParser(description = 'Execute all the blocks in a markdown script') | |
args.add_argument('file_path', help = 'File you want to execute') | |
args = args.parse_args() | |
with open(args.file_path, 'r') as file: |
# Creates ".bashtrash" directory if it doesn't exist; then it moves things to it | |
function trash { | |
if [ ! -d "$HOME/.bashtrash" ] | |
then | |
mkdir "$HOME/.bashtrash" | |
fi | |
mv "$@" "$HOME/.bashtrash" | |
} |
## Python Commander | |
class simple_shell(): | |
def __init__(self): | |
while True: | |
self.listener() | |
## Listener Function (required) | |
def listener(self): | |
self.user_input = input('---\nuser: ').split(' ') | |
try: |
## std lib | |
import sys, os | |
## ext req | |
import autograd.numpy as np | |
from autograd import grad | |
import autograd.scipy.signal as signal | |
## _ _ _ Get Model Output _ _ _ |