Skip to content

Instantly share code, notes, and snippets.

View dkatz23238's full-sized avatar
🏠
Working from home

David Emmanuel Katz dkatz23238

🏠
Working from home
View GitHub Profile
@dkatz23238
dkatz23238 / tutorial_dpcca_computation.ipynb
Created February 1, 2019 16:02 — forked from jaimeide/tutorial_dpcca_computation.ipynb
Python implementation of the Detrended Partial Cross-Correlation Analysis (DPCCA) coefficient
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"workbench.colorTheme": "Tomorrow Night Blue",
"python.pythonPath": "C:\\ProgramData\\Miniconda2\\envs\\robots2\\python.exe",
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k", "C:\\Program Files\\cmder\\vendor\\init.bat"
],
"python.jediEnabled": false,
"window.zoomLevel": 0,
"git.ignoreMissingGitWarning": true,
version: "2"
services:
mongo:
image: "bitnami/mongodb:latest"
ports:
- "127.0.0.1:27018:27017"
volumes:
- .mongo:/data/db
from io import BytesIO
import requests
from pandas import read_csv
def pandas_read_gsheets(GSHEET_ID):
''' Returns a pandas DataFrame from a spreadsheet in google sheets. Make sure the spreadsheet has a "view" link and only contains one tab of data.'''
r = requests.get('https://docs.google.com/spreadsheets/d/%s/export?format=csv' % GSHEET_ID)
data = r.content
df = read_csv(BytesIO(data))
return df
@dkatz23238
dkatz23238 / 0. pybotlib-RPA-protocol.md
Last active April 8, 2019 19:21
pybotlib-protocol

The Pybotlib Protocol Spec Sheet

This document specifies the best practices for building RPA's in python using pybotlib. These requirements and specifications are the result of many years of building RPA's with python and deploying them to remote virtual Desktops using both Linux and Windows operating systems.

Definitions

  • pybotlib RPA: pybotlib RPA refers to a specific robotic process automation developed using the pybotlib and other python tools. When referring to an individual pybotlib RPA we are referring to all of the individual and static source code files that are hosted in a git repository and ready to be deployed.

A pybotlib RPA must follow the following directory structure:

@dkatz23238
dkatz23238 / run_RPA.py
Created March 28, 2019 02:55
Test RPA build with pybotlib
import os
import glob
import datetime
import time
from shutil import move as moveFile
from pybotlib import VirtualAgent
from pandas import DataFrame, read_excel, read_csv
from pybotlib.utils import check_and_dl_chrome_driver
from os.path import join
from selenium.webdriver.common.keys import Keys
@dkatz23238
dkatz23238 / execute_it.sh
Created March 28, 2019 03:07
Execution shell script from docker-compose to within a docker container running an x11vnc server
docker-compose exec <container name> sh -c "COMMAND1 && COMMAND2 && COMMAND3 && ... "
# If GUI apps need to be started the following code can be used
docker-compose exec <container name> sh -c "export DISPLAY=:1"
@dkatz23238
dkatz23238 / write-file-to-minio.py
Created March 29, 2019 13:52
Write a file to minio
from minio import Minio
from minio.error import ResponseError, BucketAlreadyOwnedByYou, BucketAlreadyExists
import os
import glob
import uuid
MINIO_PORT = 9000
HOST_URI = <Minio Host URI>
OUTPUT_BUCKET_NAME = <BUCKET NAME>
ACCESS_KEY = <ACCESS KEY>
nohup python pybot-deploy.py deployment/ &> output.txt &
@dkatz23238
dkatz23238 / coolPS1.sh
Created April 8, 2019 18:12
Another cool ps1
export PS1="[\`if [ \$? = 0 ]; then echo \[\e[32m\]✔\[\e[0m\]; else echo \[\e[31m\]✘\[\e[0m\]; fi\`]──[\[\e[01;49;39m\]\[\033[38;5;13m\]\u\[$(tput sgr0)\]@\[\033[38;5;10m\]\H\[$(tput sgr0)\]]───[\[\e[1;49;34m\]\W\[\e[0m\]]──[\[\e[1;49;39m\]\$(ls | wc -l) files, \$(ls -lah | grep -m 1 total | sed 's/total //')\[\e[0m\]]\n "