# Path: marcottievents/etl/ecsv/base.py
# class BaseCSV(object):
#     def __init__(self, directory):
#         self.directory = directory
# 
#     @staticmethod
#     def column(field, **kwargs):
#         try:
#             value = kwargs[field].strip()
#             return value if value != "" else None
#         except (AttributeError, KeyError, TypeError) as ex:
#             return None
# 
#     def column_unicode(self, field, **kwargs):
#         try:
#             return self.column(field, **kwargs).decode('utf-8')
#         except (KeyError, AttributeError):
#             return None
# 
#     def column_int(self, field, **kwargs):
#         try:
#             return int(self.column(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
#     def column_bool(self, field, **kwargs):
#         try:
#             return bool(self.column_int(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
#     def column_float(self, field, **kwargs):
#         try:
#             return float(self.column(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
# def extract(func):
#     """
#     Decorator function. Open and extract data from CSV files.  Return list of dictionaries.
# 
#     :param func: Wrapped function with *args and **kwargs arguments.
#     """
#     def _wrapper(*args):
#         out = []
#         instance, prefix = args
#         for fname in glob.glob(os.path.join(getattr(instance, 'directory'), *prefix)):
#             with open(fname) as g:
#                 out.extend(func(instance, data=csv.DictReader(g)))
#         return out
#     return _wrapper


from .base import BaseCSV, extract
        return [dict(remote_id=self.column("ID", **keys),
                     name=self.column_unicode("Venue Name", **keys),
                     city=self.column_unicode("City", **keys),
                     region=self.column_unicode("Region", **keys),
                     country=self.column_unicode("Country", **keys),
                     timezone=self.column_unicode("Timezone", **keys),
                     latitude=self.column_float("Latitude", **keys),
                     longitude=self.column_float("Longitude", **keys),
                     altitude=self.column_int("Altitude", **keys),
                     config_date=self.column("Config Date", **keys),
                     surface=self.column_unicode("Surface", **keys),
                     length=self.column_int("Length", **keys),
                     width=self.column_int("Width", **keys),
                     capacity=self.column_int("Capacity", **keys),
                     seats=self.column_int("Seats", **keys))
                for keys in kwargs.get('data')]

    @extract
    def surfaces(self, *args, **kwargs):
        return [dict(description=self.column_unicode("Description", **keys),
                     surface_type=self.column("Type", **keys))
                for keys in kwargs.get('data')]

    @extract
    def timezones(self, *args, **kwargs):
        return [dict(name=self.column_unicode("Name", **keys),
                     confed=self.column("Confederation", **keys),
                     offset=self.column_float("Offset", **keys))
                for keys in kwargs.get('data')]


# Path: marcottievents/etl/ecsv/base.py
# class BaseCSV(object):
#     def __init__(self, directory):
#         self.directory = directory
# 
#     @staticmethod
#     def column(field, **kwargs):
#         try:
#             value = kwargs[field].strip()
#             return value if value != "" else None
#         except (AttributeError, KeyError, TypeError) as ex:
#             return None
# 
#     def column_unicode(self, field, **kwargs):
#         try:
#             return self.column(field, **kwargs).decode('utf-8')
#         except (KeyError, AttributeError):
#             return None
# 
#     def column_int(self, field, **kwargs):
#         try:
#             return int(self.column(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
#     def column_bool(self, field, **kwargs):
#         try:
#             return bool(self.column_int(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
#     def column_float(self, field, **kwargs):
#         try:
#             return float(self.column(field, **kwargs))
#         except (KeyError, TypeError):
#             return None
# 
# def extract(func):
#     """
#     Decorator function. Open and extract data from CSV files.  Return list of dictionaries.
# 
#     :param func: Wrapped function with *args and **kwargs arguments.
#     """
#     def _wrapper(*args):
#         out = []
#         instance, prefix = args
#         for fname in glob.glob(os.path.join(getattr(instance, 'directory'), *prefix)):
#             with open(fname) as g:
#                 out.extend(func(instance, data=csv.DictReader(g)))
#         return out
#     return _wrapper


# Path: marcottievents/etl/ecsv/default.py
from .base import BaseCSV, extract

        return [dict(remote_id=self.column("ID", **keys),
                     name=self.column_unicode("Venue Name", **keys),
                     city=self.column_unicode("City", **keys),
                     region=self.column_unicode("Region", **keys),
                     country=self.column_unicode("Country", **keys),
                     timezone=self.column_unicode("Timezone", **keys),
                     latitude=self.column_float("Latitude", **keys),
                     longitude=self.column_float("Longitude", **keys),
                     altitude=self.column_int("Altitude", **keys),
                     config_date=self.column("Config Date", **keys),
                     surface=self.column_unicode("Surface", **keys),
                     length=self.column_int("Length", **keys),
                     width=self.column_int("Width", **keys),
                     capacity=self.column_int("Capacity", **keys),
                     seats=self.column_int("Seats", **keys))
                for keys in kwargs.get('data')]

    @extract
    def surfaces(self, *args, **kwargs):
        return [dict(description=self.column_unicode("Description", **keys),
                     surface_type=self.column("Type", **keys))
                for keys in kwargs.get('data')]

    @extract
    def timezones(self, *args, **kwargs):
        return [dict(name=self.column_unicode("Name", **keys),
                     confed=self.column("Confederation", **keys),
                     offset=self.column_float("Offset", **keys))
                for keys in kwargs.get('data')]


    @extract