Skip to content
Snippets Groups Projects
Commit f85b5af3 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

WIP: Adapt imports to new submodule structure

parent f97f3b1c
Branches
Tags
2 merge requests!181Release 0.9.0,!180F converter submodule
from . import converters, utils, xml_converter from . import converters, utils, xml_converter
try:
from .conv_impl.spss import SPSSConverter
except ImportError as err:
SPSSConverter: type = utils.MissingImport(
name="SPSSConverter", hint="Try installing with the `spss` extra option.",
err=err)
from .crawl import Crawler, SecurityMode from .crawl import Crawler, SecurityMode
from .version import CfoodRequiredVersionError, get_caoscrawler_version from .version import CfoodRequiredVersionError, get_caoscrawler_version
__version__ = get_caoscrawler_version() __version__ = get_caoscrawler_version()
# Convenience members #########################################################
# mypy: disable-error-code="attr-defined"
converters.SPSSConverter = SPSSConverter
...@@ -19,3 +19,14 @@ ...@@ -19,3 +19,14 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Submdule containing all default and optional converters.""" """Submdule containing all default and optional converters."""
from .. import utils
from .converters import *
try:
from .converters.spss import SPSSConverter
except ImportError as err:
SPSSConverter: type = utils.MissingImport(
name="SPSSConverter", hint="Try installing with the `spss` extra option.",
err=err)
...@@ -41,12 +41,12 @@ import yaml ...@@ -41,12 +41,12 @@ import yaml
import yaml_header_tools import yaml_header_tools
from jsonschema import ValidationError, validate from jsonschema import ValidationError, validate
from .stores import GeneralStore, RecordStore from ..stores import GeneralStore, RecordStore
from .structure_elements import (BooleanElement, DictElement, Directory, File, from ..structure_elements import (BooleanElement, DictElement, Directory, File,
FloatElement, IntegerElement, JSONFile, FloatElement, IntegerElement, JSONFile,
ListElement, NoneElement, StructureElement, ListElement, NoneElement, StructureElement,
TextElement) TextElement)
from .utils import has_parent from ..utils import has_parent
# These are special properties which are (currently) treated differently # These are special properties which are (currently) treated differently
# by the converters: # by the converters:
......
...@@ -36,8 +36,8 @@ import linkahead as db ...@@ -36,8 +36,8 @@ import linkahead as db
from .converters import (convert_basic_element, Converter, DictElementConverter, from .converters import (convert_basic_element, Converter, DictElementConverter,
match_name_and_value, SimpleFileConverter) match_name_and_value, SimpleFileConverter)
from .stores import GeneralStore, RecordStore from ..stores import GeneralStore, RecordStore
from .structure_elements import DictElement, File, FloatElement, IntegerElement, StructureElement from ..structure_elements import DictElement, File, FloatElement, IntegerElement, StructureElement
def convert_attributes(elt: Union[h5py.File, h5py.Group, h5py.Dataset]): def convert_attributes(elt: Union[h5py.File, h5py.Group, h5py.Dataset]):
......
...@@ -28,7 +28,8 @@ import pandas as pd ...@@ -28,7 +28,8 @@ import pandas as pd
import pyreadstat import pyreadstat
import yaml import yaml
from .. import converters import .converters
from ..stores import GeneralStore from ..stores import GeneralStore
from ..structure_elements import (File, StructureElement) from ..structure_elements import (File, StructureElement)
from typing import Optional, Any from typing import Optional, Any
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment