aboutsummaryrefslogtreecommitdiffstats
path: root/bsie
diff options
context:
space:
mode:
Diffstat (limited to 'bsie')
-rw-r--r--bsie/apps/index.py7
-rw-r--r--bsie/base/__init__.py8
-rw-r--r--bsie/base/reader.py8
-rw-r--r--bsie/lib/__init__.py7
-rw-r--r--bsie/reader/stat.py2
-rw-r--r--bsie/tools/__init__.py4
-rw-r--r--bsie/utils/bsfs.py3
-rw-r--r--bsie/utils/node.py18
8 files changed, 30 insertions, 27 deletions
diff --git a/bsie/apps/index.py b/bsie/apps/index.py
index 821aa4c..aa26d0f 100644
--- a/bsie/apps/index.py
+++ b/bsie/apps/index.py
@@ -9,14 +9,11 @@ import argparse
import os
import typing
-# bsfs imports
-import bsfs
-
# bsie imports
from bsie.base import errors
-from bsie.lib.bsie import BSIE
+from bsie.lib import BSIE
from bsie.tools import builder
-from bsie.utils.bsfs import URI
+from bsie.utils import bsfs
# exports
__all__: typing.Sequence[str] = (
diff --git a/bsie/base/__init__.py b/bsie/base/__init__.py
index 0154862..0d362cd 100644
--- a/bsie/base/__init__.py
+++ b/bsie/base/__init__.py
@@ -11,14 +11,14 @@ import typing
# inner-module imports
from . import errors
-from . import extractor
-from . import reader
+from .extractor import Extractor
+from .reader import Reader
# exports
__all__: typing.Sequence[str] = (
+ 'Extractor',
+ 'Reader',
'errors',
- 'extractor',
- 'reader',
)
## EOF ##
diff --git a/bsie/base/reader.py b/bsie/base/reader.py
index b7eabf7..cbabd36 100644
--- a/bsie/base/reader.py
+++ b/bsie/base/reader.py
@@ -13,7 +13,7 @@ import abc
import typing
# bsie imports
-from bsie.utils.bsfs import URI, typename
+from bsie.utils import bsfs
# exports
__all__: typing.Sequence[str] = (
@@ -27,10 +27,10 @@ class Reader(abc.ABC):
"""Read and return some content from a file."""
def __str__(self) -> str:
- return typename(self)
+ return bsfs.typename(self)
def __repr__(self) -> str:
- return f'{typename(self)}()'
+ return f'{bsfs.typename(self)}()'
def __eq__(self, other: typing.Any) -> bool:
return isinstance(other, type(self))
@@ -39,7 +39,7 @@ class Reader(abc.ABC):
return hash(type(self))
@abc.abstractmethod
- def __call__(self, path: URI) -> typing.Any:
+ def __call__(self, path: bsfs.URI) -> typing.Any:
"""Return some content of the file at *path*.
Raises a `ReaderError` if the reader cannot make sense of the file format.
"""
diff --git a/bsie/lib/__init__.py b/bsie/lib/__init__.py
index f6c9018..578c2c4 100644
--- a/bsie/lib/__init__.py
+++ b/bsie/lib/__init__.py
@@ -7,7 +7,12 @@ Author: Matthias Baumgartner, 2022
# imports
import typing
+# inner-module imports
+from .bsie import BSIE
+
# exports
-__all__: typing.Sequence[str] = []
+__all__: typing.Sequence[str] = (
+ 'BSIE',
+ )
## EOF ##
diff --git a/bsie/reader/stat.py b/bsie/reader/stat.py
index 592d912..fc5fb24 100644
--- a/bsie/reader/stat.py
+++ b/bsie/reader/stat.py
@@ -9,7 +9,7 @@ import os
import typing
# bsie imports
-from bsie.base import reader, errors
+from bsie.base import errors, reader
# exports
__all__: typing.Sequence[str] = (
diff --git a/bsie/tools/__init__.py b/bsie/tools/__init__.py
index 8ca9620..803c321 100644
--- a/bsie/tools/__init__.py
+++ b/bsie/tools/__init__.py
@@ -9,12 +9,12 @@ import typing
# inner-module imports
from . import builder
-from . import pipeline
+from .pipeline import Pipeline
# exports
__all__: typing.Sequence[str] = (
'builder',
- 'pipeline',
+ 'Pipeline',
)
## EOF ##
diff --git a/bsie/utils/bsfs.py b/bsie/utils/bsfs.py
index a4b7626..c48049d 100644
--- a/bsie/utils/bsfs.py
+++ b/bsie/utils/bsfs.py
@@ -8,13 +8,14 @@ Author: Matthias Baumgartner, 2022
import typing
# bsfs imports
-from bsfs import schema
+from bsfs import Open, schema
from bsfs.namespace import Namespace
from bsfs.utils import URI, typename, uuid
# exports
__all__: typing.Sequence[str] = (
'Namespace',
+ 'Open',
'URI',
'schema',
'typename',
diff --git a/bsie/utils/node.py b/bsie/utils/node.py
index c9c494f..ecf39cd 100644
--- a/bsie/utils/node.py
+++ b/bsie/utils/node.py
@@ -8,7 +8,7 @@ Author: Matthias Baumgartner, 2022
import typing
# bsie imports
-from bsie.utils.bsfs import URI, typename
+from bsie.utils import bsfs
# exports
__all__: typing.Sequence[str] = (
@@ -22,19 +22,19 @@ class Node():
"""Lightweight Node, disconnected from any bsfs structures."""
# node type.
- node_type: URI
+ node_type: bsfs.URI
# node URI.
- uri: URI
+ uri: bsfs.URI
def __init__(
self,
- node_type: URI,
- uri: URI,
+ node_type: bsfs.URI,
+ uri: bsfs.URI,
):
# assign members
- self.node_type = URI(node_type)
- self.uri = URI(uri)
+ self.node_type = bsfs.URI(node_type)
+ self.uri = bsfs.URI(uri)
def __eq__(self, other: typing.Any) -> bool:
return isinstance(other, Node) \
@@ -45,9 +45,9 @@ class Node():
return hash((type(self), self.node_type, self.uri))
def __str__(self) -> str:
- return f'{typename(self)}({self.node_type}, {self.uri})'
+ return f'{bsfs.typename(self)}({self.node_type}, {self.uri})'
def __repr__(self) -> str:
- return f'{typename(self)}({self.node_type}, {self.uri})'
+ return f'{bsfs.typename(self)}({self.node_type}, {self.uri})'
## EOF ##