From 7aec155334f661744b3de2d50043c46edff5bba6 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 3 Dec 2025 09:40:24 -0600 Subject: [PATCH] bug fix: refactored info folder --- bin/transport | 16 +++++++++++++++- pyproject.toml | 6 +++--- transport/__init__.py | 2 +- transport/iowrapper.py | 24 ++++-------------------- transport/registry.py | 2 +- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/bin/transport b/bin/transport index 75d3663..37aa82c 100755 --- a/bin/transport +++ b/bin/transport @@ -155,6 +155,10 @@ def initregistry (email:Annotated[str,typer.Argument(help="email")], _msg = f"{TIMES_MARK} {e}" print (_msg) print () + + + + @app_r.command(name="add") def register (label:Annotated[str,typer.Argument(help="unique label that will be used to load the parameters of the database")], auth_file:Annotated[str,typer.Argument(help="path of the auth_file")], @@ -174,7 +178,17 @@ def register (label:Annotated[str,typer.Argument(help="unique label that will be _msg = f"""{TIMES_MARK} {e}""" print (_msg) - pass +@app_r.command(name="list") +def register_list (): + """ + This function will list existing registry entries and basic information {label,vendor} + """ + # print (transport.registry.DATA) + _reg = transport.registry.DATA + _data = [{'label':key,'provider':_reg[key]['provider']} for key in _reg if 'provider' in _reg[key]] + _data = pd.DataFrame(_data) + print (_data) + @app_x.command(name='add') def register_plugs ( alias:Annotated[str,typer.Argument(help="unique function name within a file")], diff --git a/pyproject.toml b/pyproject.toml index b04071d..0391412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,11 +42,11 @@ zip-safe = false script-files = ["bin/transport","bin/transport.cmd"] [tool.setuptools.packages.find] -include = ["info","info.*", "transport", "transport.*"] +include = [ "transport", "transport.*"] [tool.setuptools.dynamic] -version = {attr = "info.__version__"} -#authors = {attr = "meta.__author__"} +version = {attr = "transport.info.__version__"} +#authors = {attr = "transport.__author__"} # If you have a info.py file, you might also want to include the author dynamically: # [tool.setuptools.dynamic] diff --git a/transport/__init__.py b/transport/__init__.py index 8ace570..c9c965c 100644 --- a/transport/__init__.py +++ b/transport/__init__.py @@ -41,7 +41,7 @@ except Exception as e: import pandas as pd import json import os -from info import __version__,__author__,__email__,__license__,__app_name__,__whatsnew__,__edition__ +from transport.info import __version__,__author__,__email__,__license__,__app_name__,__whatsnew__,__edition__ from transport.iowrapper import IWriter, IReader, IETL from transport.plugins import PluginLoader from transport import providers diff --git a/transport/iowrapper.py b/transport/iowrapper.py index 173c227..54daf13 100644 --- a/transport/iowrapper.py +++ b/transport/iowrapper.py @@ -212,27 +212,10 @@ class IETL(BaseIO) : This class performs an ETL operation by ineriting a read and adding writes as pipeline functions """ def __init__(self,**_args): - # _source = _args['source'] - # _plugins = _source['plugins'] if 'plugins' in _source else None - - # # super().__init__(transport.get.reader(**_args['source'])) - # super().__init__(agent=transport.get.reader(**_source),plugins=_plugins) - # # _logger = - # if 'target' in _args: - # self._targets = _args['target'] if type(_args['target']) == list else [_args['target']] - # else: - # self._targets = [] - # self.jobs = [] - - # # - # # If the parent is already multiprocessing - # if 'token' in _source : - # self._logToken = _source['token'] - # self._sourceArgs = _source['args'] if 'args' in _source else None - # self._hasParentProcess = False if 'hasParentProcess' not in _args else _args['hasParentProcess'] + super().__init__() self._source = _args['source'] - self._targets= _args['target'] if _args['target'] == list else [_args['target']] + self._targets= _args['target'] if type(_args['target']) == list else [_args['target']] # # ETL Initialization, we should provide some measure of context ... # @@ -254,7 +237,8 @@ class IETL(BaseIO) : _data = _reader.read(**self._source['args'])if 'args' in self._source else _reader.read() _reader.close() _writers = [transport.get.writer(**_kwargs) for _kwargs in self._targets] - _schema = [] if not getattr(_reader._agent,'_table') else _reader.meta() + # _schema = [] if not getattr(_reader._agent,'_table') else _reader.meta() + _schema = [] if not hasattr(_reader._agent,'_table') else _reader.meta() if types.GeneratorType == type(_data): _index = 0 for _segment in _data : diff --git a/transport/registry.py b/transport/registry.py index 9fe12f6..a225a7f 100644 --- a/transport/registry.py +++ b/transport/registry.py @@ -1,6 +1,6 @@ import os import json -from info import __version__ +from transport.info import __version__ import copy import transport import importlib