"""Spreadsheet importers in CSV and Excel formats.

The basic premise is that the spreadsheet to be imported will have
headers on the first row -- some of which are mandatory.

The headers are used to map the data to a dynamically-generated class so
(mapping columns to their values)**.

The code in this __init__ module is used in the inner modules.
"""

try:
from bag.web.pyramid import _
except ImportError:
_ = str  # and i18n is disabled.

def __repr__(self):

def __str__(self):
else:
return self.msg2 + ', '.join([

def __repr__(self):

def __str__(self):
else:
return self.msg2 + ', '.join(['"{}"'.format(h) for h in self.forbidden_headers])

case_sensitive=False):
"""Ensure all required_headers are present in headers.

"""
if not case_sensitive:
else:

case_sensitive=False):
"""Ensure all forbidden_headers are not present in headers.

"""
if not case_sensitive:
else:

case_sensitive=False):
"""Return variable names corresponding to the legible headers.

The parameter required_headers may be a map or a sequence. If map,
the keys should be the legible header names and the values should be
the corresponding variable names.  For headers absent from the map,
or if required_headers is a list, the variable names returned
are the result of string conversion.
"""
if not case_sensitive: