Skip to content

Instantly share code, notes, and snippets.

View koenvo's full-sized avatar
💭
Owner teamtv

koenvo

💭
Owner teamtv
View GitHub Profile
@koenvo
koenvo / goal_dict.py
Last active January 4, 2016 16:59 — forked from dtheodor/goal_dict.py
GaTransactionConf = namedtuple("GaTransactionConf", ["sku", "name", "category"])
class GaTransactionsDict(dict):
def __getitem__(self, key):
if isinstance(key, GaTransactionConf):
updated = False
for mapping in self.keys():
if cmp_ga_conf(key, mapping):
key = mapping #update the key
@koenvo
koenvo / csvprocessor.py
Created December 2, 2015 14:07 — forked from miku/csvprocessor.py
CSV processor examples for luigi. Can serialize *args to CSV. Can deserialize CSV rows into namedtuples if requested. -- "works on my machine".
from luigi.format import Format
import csvkit
class CSVOutputProcessor(object):
"""
A simple CSV output processor to be hooked into Format's
`pipe_writer`.
If `cols` are given, the names are used as CSV header, otherwise no
explicit header is written.