aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/extractor/generic/constant.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2022-12-24 10:27:09 +0100
committerMatthias Baumgartner <dev@igsor.net>2022-12-24 10:27:09 +0100
commit266c2c9a072bf3289fd7f2d75278b7d59528378c (patch)
tree60760e0fec84d5cd7b3f3efef11e3892df5cc85a /bsie/extractor/generic/constant.py
parented2074ae88f2db6cb6b38716b43b35e29eb2e16c (diff)
downloadbsie-266c2c9a072bf3289fd7f2d75278b7d59528378c.tar.gz
bsie-266c2c9a072bf3289fd7f2d75278b7d59528378c.tar.bz2
bsie-266c2c9a072bf3289fd7f2d75278b7d59528378c.zip
package restructuring: base
* Reader and Extractor to respective reader/extractor modules * ReaderBuilder to reader module * ExtractorBuilder to extractor module * Loading module in utils (safe_load, unpack_name) * Pipeline and PipelineBuilder to lib module * errors to utils * documentation: "standard import" and "external import"
Diffstat (limited to 'bsie/extractor/generic/constant.py')
-rw-r--r--bsie/extractor/generic/constant.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bsie/extractor/generic/constant.py b/bsie/extractor/generic/constant.py
index 11384e6..7b1d942 100644
--- a/bsie/extractor/generic/constant.py
+++ b/bsie/extractor/generic/constant.py
@@ -4,13 +4,15 @@ Part of the bsie module.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
-# imports
+# standard imports
import typing
# bsie imports
-from bsie.base import extractor
from bsie.utils import bsfs, node
+# inner-module imports
+from .. import base
+
# exports
__all__: typing.Sequence[str] = (
'Constant',
@@ -19,7 +21,7 @@ __all__: typing.Sequence[str] = (
## code ##
-class Constant(extractor.Extractor):
+class Constant(base.Extractor):
"""Extract information from file's path."""
CONTENT_READER = None
@@ -32,7 +34,7 @@ class Constant(extractor.Extractor):
schema: str,
tuples: typing.Iterable[typing.Tuple[bsfs.URI, typing.Any]],
):
- super().__init__(bsfs.schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + schema))
+ super().__init__(bsfs.schema.Schema.from_string(base.SCHEMA_PREAMBLE + schema))
# NOTE: Raises a KeyError if the predicate is not part of the schema
self._tuples = tuple((self.schema.predicate(p_uri), value) for p_uri, value in tuples)
# TODO: use schema instance for value checking