debian-python-pyexcel-io/pyexcel_io/constants.py

62 lines
1.8 KiB
Python

"""
pyexcel_io.constants
~~~~~~~~~~~~~~~~~~~
Constants appeared in pyexcel
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License
"""
# flake8: noqa
DEFAULT_NAME = "pyexcel"
DEFAULT_SHEET_NAME = "%s_sheet1" % DEFAULT_NAME
DEFAULT_PLUGIN_NAME = "__%s_io_plugins__" % DEFAULT_NAME
MESSAGE_INVALID_PARAMETERS = "Invalid parameters"
MESSAGE_ERROR_02 = "No content, file name. Nothing is given"
MESSAGE_ERROR_03 = "cannot handle unknown content"
MESSAGE_WRONG_IO_INSTANCE = "Wrong io instance is passed for your file format."
MESSAGE_CANNOT_WRITE_STREAM_FORMATTER = (
"Cannot write content of file type %s to stream"
)
MESSAGE_CANNOT_READ_STREAM_FORMATTER = (
"Cannot read content of file type %s from stream"
)
MESSAGE_CANNOT_WRITE_FILE_TYPE_FORMATTER = (
"Cannot write content of file type %s to file %s"
)
MESSAGE_CANNOT_READ_FILE_TYPE_FORMATTER = (
"Cannot read content of file type %s from file %s"
)
MESSAGE_LOADING_FORMATTER = (
"The plugin for file type %s is not installed. Please install %s"
)
MESSAGE_EMPTY_ARRAY = "One empty row is found"
MESSAGE_IGNORE_ROW = "One row is ignored"
MESSAGE_DB_EXCEPTION = """
Warning: Bulk insertion got below exception. Trying to do it one by one slowly."""
FILE_FORMAT_CSV = "csv"
FILE_FORMAT_TSV = "tsv"
FILE_FORMAT_CSVZ = "csvz"
FILE_FORMAT_TSVZ = "tsvz"
FILE_FORMAT_ODS = "ods"
FILE_FORMAT_XLS = "xls"
FILE_FORMAT_XLSX = "xlsx"
FILE_FORMAT_XLSM = "xlsm"
DB_SQL = "sql"
DB_DJANGO = "django"
KEYWORD_TSV_DIALECT = "excel-tab"
KEYWORD_LINE_TERMINATOR = "lineterminator"
SKIP_DATA = -1
TAKE_DATA = 0
STOP_ITERATION = 1
DEFAULT_MULTI_CSV_SEPARATOR = "__"
SEPARATOR_FORMATTER = "---%s---" % DEFAULT_NAME + "%s"
SEPARATOR_MATCHER = "---%s:(.*)---" % DEFAULT_NAME
DEFAULT_CSV_STREAM_FILE_FORMATTER = "---%s:" % DEFAULT_NAME + "%s---%s"
DEFAULT_CSV_NEWLINE = "\r\n"