Skip to content

Instantly share code, notes, and snippets.

View clintmjohnson's full-sized avatar

Clint Johnson clintmjohnson

View GitHub Profile
@sudar
sudar / gsheet.py
Created August 31, 2014 07:18
Read data from Google Sheet into a Python Pandas DataFrame. Details at http://sudarmuthu.com/blog/read-data-from-google-sheet-into-a-python-pandas-dataframe/
import gspread
import pandas
gc = gspread.login('[email protected]', 'supersecretepassword')
book = gc.open('Spreadsheet name')
sheet = book.sheet1 #choose the first sheet
dataframe = pandas.DataFrame(sheet.get_all_records())
@hmarquardt
hmarquardt / putEbayShipments.py
Created August 6, 2014 14:49
Ebay -- Complete Order/Add Shipping Info script using the Python EbaySDK (https://github.com/timotheus/ebaysdk-python). This uses v1.0 of the SDK, I've not yet migrated to v2.0 -- Added here because finding example code was hard when I needed to solve this problem. Basically get tracking number and Ebay order number from local Oracle store and u…
# -*- coding: utf-8 -*-
'''
Hank Marquardt
May 26, 2014
'''
import os
import sys
@hmarquardt
hmarquardt / getEbayOrders.py
Last active September 16, 2021 22:40
Fetch orders script using the Python EbaySDK (https://github.com/timotheus/ebaysdk-python). This uses v1.0 of the SDK, I've not yet migrated to v2.0 -- Added here because finding example code was hard when I needed to solve this problem. Basically fetch and insert into our local Oracle database. Not a completely working example. ebay.yaml is req…
# -*- coding: utf-8 -*-
'''
Hank Marquardt
May 26, 2014
Magic -- not really documented properly by *ebay*, the IncludeItemSpecifics is needed to get UPC back in feed
api.execute('GetItem',{'ItemID': '321394881000','DetailLevel': 'ReturnAll','IncludeItemSpecifics': 'True'})
'''
@thinrhino
thinrhino / send_email.py
Created May 2, 2014 10:34
Send mails using Mandrill API
from mandrill import Mandrill
import base64
mail_client = Mandrill('<api_key>')
frm_email = '[email protected]'
frm_name = 'Given Name'
# Sending image as attachment
img_attachment = base64.b64encode(open('~/sample_image.jpg', 'rb').read())
@styrmis
styrmis / download_attachments_from_sender_gmail.py
Created March 19, 2014 08:55
Download all attachments from Gmail from a specific sender
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
class ResponseDataObject(object):
def __init__(self, mydict={}):
self._load_dict(mydict)
def __repr__(self):
return str(self)
def __str__(self):
return unicode(self).encode('utf-8')
import sys, csv, BeautifulSoup
from ebaysdk import finding
import pandas as pd
import sklearn
import cgi, cgitb
import matplotlib.pyplotlib as plt
import MySQLdb
#form = cgi.FieldStorage()
#!/usr/bin/python
import imaplib
import csv
from email import message_from_string
import time
srv = imaplib.IMAP4_SSL("imap.gmail.com")
srv.login('[email protected]', 'joepw')
srv.select('[Gmail]/Drafts')
@janinge
janinge / ebay.py
Last active December 29, 2015 00:59
INFO207 spaghetti.
#!/usr/bin/env python
EBAY_APP_ID = ''
EBAY_DEV_ID = ''
EBAY_CER_ID = ''
EBAY_USER_TOKEN = ''
EBAY_CATEGORIES = [
31388, # Digital Cameras
11724, # Camcorders
@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib