Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jgarciabu
jgarciabu / moveFilesWithSizeLimit.py
Last active October 7, 2019 18:04
Script created to monitor an incoming file directory and move files, from oldest to newest, to another directory to be processed by another data flow process. The key to this script is to limit the file moves to 200MB so that the data flow process doesn't choke when RAM runs out. Additionally, if a single file exceeds 200 MB, then an email goes …
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 25 10:16:33 2019
@author: jeffrey.garcia
"""
import os
import shutil
import smtplib
@jgarciabu
jgarciabu / con_fbml.py
Created October 10, 2018 19:52
Sample kick off script of member list automation process
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 13:11:43 2018
@author: jeffrey.garcia
"""
from datetime import datetime
from ML_Automation import con_fb
from ML_Automation import ml_validation
@jgarciabu
jgarciabu / ml_automation.py
Created October 10, 2018 19:49
Code lib created to house all functions necessary to process data for this use case.
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 11:56:27 2018
@author: jeffrey.garcia
"""
import pandas as pd
import numpy as np
import csv
@jgarciabu
jgarciabu / master_file_cleanup.py
Created October 5, 2018 14:32
Remove rows from file that cause failure in processing
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 09:05:18 2018
@author: jeffrey.garcia
"""
import pandas as pd
import os
import inspect; os.path
@jgarciabu
jgarciabu / filescan.py
Created October 5, 2018 14:30
File scan tool to report file metadata (number of columns, column names, filename, etc)
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 8 13:57:08 2018
@author: jeffrey.garcia
"""
import pandas as pd
import os
import inspect; os.path
@jgarciabu
jgarciabu / gui_search.py
Created October 5, 2018 14:24
Directory Search Tool (With GUI)
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 27 14:03:28 2018
@author: jeffrey.garcia
"""
import wx
import pandas as pd
import os
@jgarciabu
jgarciabu / IBSBwithExceptionHandlingShareable.py
Created August 30, 2017 23:03
Python Selenium Bot used to create new mobile banking accounts for new consultants
from selenium import webdriver
import csv
import getpass
# create new instance of Firefox driver
browser = webdriver.Firefox()
# go to First Ipswich Bank website
browser.get("https://ssl.selectpayment.com/mp/fnbicom/login/page.aspx")
# Fill out login credentials (username, password, company name)
@jgarciabu
jgarciabu / InvoiceProcessingScriptShareable.R
Created August 30, 2017 22:23
This R script uses dplyr and RODBC to combine individual CSVs into one dataframe that is then uploaded into a Azure SQL database. This cuts down manual processing significantly. Sometimes I'll get 10 or 12 individual csvs and this script frees me up to focus on other processes and tasks.
library(plyr)
library(dplyr)
library(stringr)
library(RODBC)
#========================================
#Make sure working directory is new invoice folder in Dropbox
#Names of all files put in list to feed to merge code
filenames <- list.files()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 27 15:15:31 2017
@author: Jeff Garcia
Make a two-player Rock-Paper-Scissors game. (Hint: Ask for player plays
(using input), compare them, print out a message of congratulations to the
winner, and ask if the players want to start a new game)
@jgarciabu
jgarciabu / Ex 15 List Reverse.py
Created August 9, 2017 19:47
Ex 15 List Reverse
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Write a program (using functions!) that asks the user for a long string
containing multiple words. Print back to the user the same string, except with
the words in backwards order. For example, say I type the string:
My name is Michele
Then I would see the string: