Skip to content

Instantly share code, notes, and snippets.

View clintmjohnson's full-sized avatar

Clint Johnson clintmjohnson

View GitHub Profile
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')
@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.
#
@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())
@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'})
'''
@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
@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())