diff --git a/ckanext/validation/settings.py b/ckanext/validation/settings.py index 003bc136..bf2dc7ac 100644 --- a/ckanext/validation/settings.py +++ b/ckanext/validation/settings.py @@ -3,12 +3,32 @@ import json import ckantoolkit as tk -from tabulator.config import PARSERS + import ckan.plugins as plugins from ckanext.validation.interfaces import IDataValidation +try: + from tabulator.config import PARSERS +except NameError: + # Point in time list of parsers from v1.53.5 if library Tabulator not loaded + PARSERS = { + 'csv': 'tabulator.parsers.csv.CSVParser', + 'datapackage': 'tabulator.parsers.datapackage.DataPackageParser', + 'gsheet': 'tabulator.parsers.gsheet.GsheetParser', + 'html': 'tabulator.parsers.html.HTMLTableParser', + 'inline': 'tabulator.parsers.inline.InlineParser', + 'json': 'tabulator.parsers.json.JSONParser', + 'jsonl': 'tabulator.parsers.ndjson.NDJSONParser', + 'ndjson': 'tabulator.parsers.ndjson.NDJSONParser', + 'ods': 'tabulator.parsers.ods.ODSParser', + 'sql': 'tabulator.parsers.sql.SQLParser', + 'tsv': 'tabulator.parsers.tsv.TSVParser', + 'xls': 'tabulator.parsers.xls.XLSParser', + 'xlsx': 'tabulator.parsers.xlsx.XLSXParser', + } + SUPPORTED_FORMATS_KEY = u"ckanext.validation.formats" DEFAULT_SUPPORTED_FORMATS = [u'csv', u'xls', u'xlsx'] DEFAULT_VALIDATION_OPTIONS_KEY = "ckanext.validation.default_validation_options" diff --git a/requirements.txt b/requirements.txt index d939f799..ccb14fba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ ckantoolkit>=0.0.3 goodtables==1.5.1 -tabulator==1.53.5 six>=1.13.0 -e git+https://github.com/ckan/ckanext-scheming.git@release-3.0.0#egg=ckanext-scheming