bug fix: refactored info folder #3

Merged
steve merged 1 commits from v2.4 into main 3 weeks ago

@ -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")],

@ -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]

@ -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

@ -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 :

@ -1,6 +1,6 @@
import os
import json
from info import __version__
from transport.info import __version__
import copy
import transport
import importlib

Loading…
Cancel
Save