From 69ae928b45d9d175b1f02d2eab6ddefca57a2d91 Mon Sep 17 00:00:00 2001 From: carson_git <543983849@qq.com> Date: Mon, 11 Jan 2021 15:55:14 +0800 Subject: [PATCH] =?UTF-8?q?py=E9=A1=B9=E7=9B=AE=E6=89=80=E6=9C=89=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- py/__init__.py | 3 - py/build/build.py | 23 +----- py/pdcopyist/__init__.py | 1 + py/{ => pdcopyist}/main.py | 5 +- py/{ => pdcopyist}/src/__init__.py | 0 .../src/controllers/command_controller.py | 6 +- py/{ => pdcopyist}/src/controllers/common.py | 6 +- .../src/controllers/cusFuns_controller.py | 6 +- .../src/controllers/groupby_controller.py | 4 +- .../src/controllers/loaddata_controller.py | 4 +- .../src/controllers/query_controller.py | 4 +- .../src/controllers/table_controller.py | 5 +- py/{ => pdcopyist}/src/core/CodeFormatter.py | 0 py/{ => pdcopyist}/src/core/Commander.py | 4 +- py/{ => pdcopyist}/src/core/MethodCall.py | 4 +- py/{ => pdcopyist}/src/core/Proxy.py | 10 +-- py/{ => pdcopyist}/src/core/Statement.py | 2 +- .../src/core}/__init__.py | 0 .../src/cusFuns}/__init__.py | 0 .../src/cusFuns/columnNameChanger/index.py | 6 +- .../src/cusFuns/columnRemover/index.py | 4 +- py/{ => pdcopyist}/src/cusFuns/core/Args.py | 4 +- .../src/cusFuns/core/DecoratorFuns.py | 4 +- .../src/cusFuns/core/FunsPool.py | 4 +- py/{ => pdcopyist}/src/cusFuns/core/UIModl.py | 2 +- py/pdcopyist/src/cusFuns/core/__init__.py | 0 .../src/cusFuns/exportFile/index_csv.py | 4 +- .../src/cusFuns/exportFile/index_excel.py | 4 +- .../src/cusFuns/exportFile/index_feather.py | 4 +- .../src/cusFuns/typeChanger/index.py | 4 +- py/{ => pdcopyist}/src/dataModel/pandasCmd.py | 2 +- py/{ => pdcopyist}/src/helper/utils.py | 0 py/res.xlsx | Bin 9871 -> 0 bytes py/src/core/__init__.py | 4 - py/src/helper/data2model.py | 74 ------------------ py/test.json | 26 ------ py/test.py | 6 -- py/test_func.py | 11 --- py/testing/Commander_test.py | 2 +- py/testing/Model_test.py | 2 +- py/testing/Proxy_test.py | 4 +- ui/package.json | 4 +- 43 files changed, 63 insertions(+), 201 deletions(-) delete mode 100644 py/__init__.py create mode 100644 py/pdcopyist/__init__.py rename py/{ => pdcopyist}/main.py (95%) rename py/{ => pdcopyist}/src/__init__.py (100%) rename py/{ => pdcopyist}/src/controllers/command_controller.py (79%) rename py/{ => pdcopyist}/src/controllers/common.py (80%) rename py/{ => pdcopyist}/src/controllers/cusFuns_controller.py (86%) rename py/{ => pdcopyist}/src/controllers/groupby_controller.py (79%) rename py/{ => pdcopyist}/src/controllers/loaddata_controller.py (87%) rename py/{ => pdcopyist}/src/controllers/query_controller.py (72%) rename py/{ => pdcopyist}/src/controllers/table_controller.py (91%) rename py/{ => pdcopyist}/src/core/CodeFormatter.py (100%) rename py/{ => pdcopyist}/src/core/Commander.py (95%) rename py/{ => pdcopyist}/src/core/MethodCall.py (94%) rename py/{ => pdcopyist}/src/core/Proxy.py (94%) rename py/{ => pdcopyist}/src/core/Statement.py (95%) rename py/{src/cusFuns => pdcopyist/src/core}/__init__.py (100%) rename py/{src/cusFuns/core => pdcopyist/src/cusFuns}/__init__.py (100%) rename py/{ => pdcopyist}/src/cusFuns/columnNameChanger/index.py (67%) rename py/{ => pdcopyist}/src/cusFuns/columnRemover/index.py (60%) rename py/{ => pdcopyist}/src/cusFuns/core/Args.py (97%) rename py/{ => pdcopyist}/src/cusFuns/core/DecoratorFuns.py (94%) rename py/{ => pdcopyist}/src/cusFuns/core/FunsPool.py (96%) rename py/{ => pdcopyist}/src/cusFuns/core/UIModl.py (96%) create mode 100644 py/pdcopyist/src/cusFuns/core/__init__.py rename py/{ => pdcopyist}/src/cusFuns/exportFile/index_csv.py (80%) rename py/{ => pdcopyist}/src/cusFuns/exportFile/index_excel.py (77%) rename py/{ => pdcopyist}/src/cusFuns/exportFile/index_feather.py (67%) rename py/{ => pdcopyist}/src/cusFuns/typeChanger/index.py (80%) rename py/{ => pdcopyist}/src/dataModel/pandasCmd.py (98%) rename py/{ => pdcopyist}/src/helper/utils.py (100%) delete mode 100644 py/res.xlsx delete mode 100644 py/src/core/__init__.py delete mode 100644 py/src/helper/data2model.py delete mode 100644 py/test.json delete mode 100644 py/test.py delete mode 100644 py/test_func.py diff --git a/.gitignore b/.gitignore index 4150713..1b79c37 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,4 @@ pnpm-debug.log* **/__pycache__ py/web -py/web/** +py/pdcopyist/web diff --git a/py/__init__.py b/py/__init__.py deleted file mode 100644 index e97edf1..0000000 --- a/py/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ - - -__version__ = tuple('0.1.4'.split('.')) diff --git a/py/build/build.py b/py/build/build.py index 74198e9..f6845a9 100644 --- a/py/build/build.py +++ b/py/build/build.py @@ -7,9 +7,6 @@ import os pkg_name = 'pdcopyist' -is_compileall = False - - os.chdir(plib.Path(__file__).parent) vinfo = sys.version_info @@ -18,32 +15,18 @@ py_num = f'{vinfo.major}{vinfo.minor}' m_target_path = plib.Path(f'../setup.py/{pkg_name}') -m_src_path = plib.Path(f'../src') -m_target_src_path = m_target_path / 'src' - -m_web_path = plib.Path(f'../web') -m_target_web_path = m_target_path / 'web' - -m_main_path = plib.Path(f'../main.py') -m_target_main_path = m_target_path / 'main.py' - -m_init_path = plib.Path(f'../__init__.py') -m_target_init_path = m_target_path / '__init__.py' +m_src_path = plib.Path(f'../{pkg_name}') m_other_path = plib.Path(f'others') # m_target_other_path = m_target_path / 'startup_win.bat' # 清空目录 shutil.rmtree(m_target_path, ignore_errors=True) -os.makedirs(m_target_path) - print('清除旧文件完毕') -shutil.copytree(m_src_path, m_target_src_path) -shutil.copytree(m_web_path, m_target_web_path) -shutil.copyfile(m_main_path, m_target_main_path) -shutil.copyfile(m_init_path, m_target_init_path) +shutil.copytree(m_src_path, m_target_path) + for f in m_other_path.glob('*.*'): shutil.copyfile(f, m_target_path/f.name) diff --git a/py/pdcopyist/__init__.py b/py/pdcopyist/__init__.py new file mode 100644 index 0000000..4ab32f6 --- /dev/null +++ b/py/pdcopyist/__init__.py @@ -0,0 +1 @@ +__version__ = tuple('0.1.5'.split('.')) diff --git a/py/main.py b/py/pdcopyist/main.py similarity index 95% rename from py/main.py rename to py/pdcopyist/main.py index 62c6377..f1cd88d 100644 --- a/py/main.py +++ b/py/pdcopyist/main.py @@ -1,5 +1,6 @@ -from .src.controllers import ( + +from pdcopyist.src.controllers import ( cusFuns_controller, query_controller, table_controller, command_controller, groupby_controller, loaddata_controller) from flask import Flask @@ -9,7 +10,7 @@ import traceback import sys -from .src.cusFuns.core.FunsPool import auto_register +from pdcopyist.src.cusFuns.core.FunsPool import auto_register import webbrowser diff --git a/py/src/__init__.py b/py/pdcopyist/src/__init__.py similarity index 100% rename from py/src/__init__.py rename to py/pdcopyist/src/__init__.py diff --git a/py/src/controllers/command_controller.py b/py/pdcopyist/src/controllers/command_controller.py similarity index 79% rename from py/src/controllers/command_controller.py rename to py/pdcopyist/src/controllers/command_controller.py index 1af5578..47de6de 100644 --- a/py/src/controllers/command_controller.py +++ b/py/pdcopyist/src/controllers/command_controller.py @@ -1,10 +1,10 @@ -from ..helper.utils import json_converter +from pdcopyist.src.helper.utils import json_converter import flask from flask import request, Blueprint import pandas as pd -from ..core.Proxy import ProxyManager -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.controllers import common app = Blueprint('command', __name__) diff --git a/py/src/controllers/common.py b/py/pdcopyist/src/controllers/common.py similarity index 80% rename from py/src/controllers/common.py rename to py/pdcopyist/src/controllers/common.py index 9bd5700..1d09707 100644 --- a/py/src/controllers/common.py +++ b/py/pdcopyist/src/controllers/common.py @@ -1,11 +1,10 @@ import json -from ..helper.utils import json_converter -from ..dataModel.pandasCmd import PandasCmd +from pdcopyist.src.helper.utils import json_converter +from pdcopyist.src.dataModel.pandasCmd import PandasCmd import flask import pandas as pd - def df2json(df: pd.DataFrame, head_tail_num=10): ret = None @@ -19,5 +18,6 @@ def df2json(df: pd.DataFrame, head_tail_num=10): ret = flask.json.dumps(cmd, default=json_converter) return ret + def get_data_from_post(): return json.loads(flask.request.get_data().decode()) diff --git a/py/src/controllers/cusFuns_controller.py b/py/pdcopyist/src/controllers/cusFuns_controller.py similarity index 86% rename from py/src/controllers/cusFuns_controller.py rename to py/pdcopyist/src/controllers/cusFuns_controller.py index 39e7a6b..7ee8174 100644 --- a/py/src/controllers/cusFuns_controller.py +++ b/py/pdcopyist/src/controllers/cusFuns_controller.py @@ -1,9 +1,9 @@ import flask from flask import request, Blueprint -from ..core.Proxy import ProxyManager -from ..helper.utils import json_converter -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.helper.utils import json_converter +from pdcopyist.src.controllers import common app = Blueprint('cus_fun', __name__) diff --git a/py/src/controllers/groupby_controller.py b/py/pdcopyist/src/controllers/groupby_controller.py similarity index 79% rename from py/src/controllers/groupby_controller.py rename to py/pdcopyist/src/controllers/groupby_controller.py index 5fbcba1..f8857ea 100644 --- a/py/src/controllers/groupby_controller.py +++ b/py/pdcopyist/src/controllers/groupby_controller.py @@ -1,7 +1,7 @@ from flask import Blueprint -from ..core.Proxy import ProxyManager -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.controllers import common app = Blueprint('groupby', __name__) diff --git a/py/src/controllers/loaddata_controller.py b/py/pdcopyist/src/controllers/loaddata_controller.py similarity index 87% rename from py/src/controllers/loaddata_controller.py rename to py/pdcopyist/src/controllers/loaddata_controller.py index 8c2346b..aecabde 100644 --- a/py/src/controllers/loaddata_controller.py +++ b/py/pdcopyist/src/controllers/loaddata_controller.py @@ -3,8 +3,8 @@ import json import flask from flask import request, Blueprint import pandas as pd -from ..core.Proxy import ProxyManager -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.controllers import common app = Blueprint('loaddata', __name__) diff --git a/py/src/controllers/query_controller.py b/py/pdcopyist/src/controllers/query_controller.py similarity index 72% rename from py/src/controllers/query_controller.py rename to py/pdcopyist/src/controllers/query_controller.py index 7a682f7..0f7912b 100644 --- a/py/src/controllers/query_controller.py +++ b/py/pdcopyist/src/controllers/query_controller.py @@ -1,7 +1,7 @@ from flask import Blueprint -from ..core.Proxy import ProxyManager -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.controllers import common app = Blueprint('query', __name__) diff --git a/py/src/controllers/table_controller.py b/py/pdcopyist/src/controllers/table_controller.py similarity index 91% rename from py/src/controllers/table_controller.py rename to py/pdcopyist/src/controllers/table_controller.py index 44926de..0fa0ef9 100644 --- a/py/src/controllers/table_controller.py +++ b/py/pdcopyist/src/controllers/table_controller.py @@ -2,8 +2,9 @@ import flask from flask import request, Blueprint import pandas as pd -from ..core.Proxy import ProxyManager -from . import common +from pdcopyist.src.core.Proxy import ProxyManager +from pdcopyist.src.controllers import common + app = Blueprint('table', __name__) diff --git a/py/src/core/CodeFormatter.py b/py/pdcopyist/src/core/CodeFormatter.py similarity index 100% rename from py/src/core/CodeFormatter.py rename to py/pdcopyist/src/core/CodeFormatter.py diff --git a/py/src/core/Commander.py b/py/pdcopyist/src/core/Commander.py similarity index 95% rename from py/src/core/Commander.py rename to py/pdcopyist/src/core/Commander.py index 814740d..03d2ddf 100644 --- a/py/src/core/Commander.py +++ b/py/pdcopyist/src/core/Commander.py @@ -2,9 +2,9 @@ from typing import List import uuid -from .Statement import AbcStatement, CodeStatement, Statement +from pdcopyist.src.core.Statement import AbcStatement, CodeStatement, Statement -from ..helper.utils import CanJson +from pdcopyist.src.helper.utils import CanJson import itertools diff --git a/py/src/core/MethodCall.py b/py/pdcopyist/src/core/MethodCall.py similarity index 94% rename from py/src/core/MethodCall.py rename to py/pdcopyist/src/core/MethodCall.py index 3eba3bc..889be3a 100644 --- a/py/src/core/MethodCall.py +++ b/py/pdcopyist/src/core/MethodCall.py @@ -1,7 +1,7 @@ from typing import List -from .CodeFormatter import CodeFormatter, GetItemCodeFormatter, MethodCodeFormatter, OperatorCodeFormatter +from pdcopyist.src.core.CodeFormatter import CodeFormatter, GetItemCodeFormatter, MethodCodeFormatter, OperatorCodeFormatter -from ..helper.utils import CanJson +from pdcopyist.src.helper.utils import CanJson class ArgAbc(object): diff --git a/py/src/core/Proxy.py b/py/pdcopyist/src/core/Proxy.py similarity index 94% rename from py/src/core/Proxy.py rename to py/pdcopyist/src/core/Proxy.py index d904fbb..383b2f4 100644 --- a/py/src/core/Proxy.py +++ b/py/pdcopyist/src/core/Proxy.py @@ -1,14 +1,14 @@ from typing import Dict, Iterable, List -from ..cusFuns.core.UIModl import CusFunInputRet, FunModel, InputRet +from pdcopyist.src.cusFuns.core.UIModl import CusFunInputRet, FunModel, InputRet -from ..cusFuns.core.FunsPool import FunsPool +from pdcopyist.src.cusFuns.core.FunsPool import FunsPool -from .CodeFormatter import CodeFormatter +from pdcopyist.src.core.CodeFormatter import CodeFormatter -from .MethodCall import AndOperatorMethodCall, ArgActor, ArgVar, EqualOperatorMethodCall, MethodCall, GetItemMethodCall, OrOperatorMethodCall -from .Commander import Commander, CommanderManager, Statement +from pdcopyist.src.core.MethodCall import AndOperatorMethodCall, ArgActor, ArgVar, EqualOperatorMethodCall, MethodCall, GetItemMethodCall, OrOperatorMethodCall +from pdcopyist.src.core.Commander import Commander, CommanderManager, Statement import pandas as pd import uuid diff --git a/py/src/core/Statement.py b/py/pdcopyist/src/core/Statement.py similarity index 95% rename from py/src/core/Statement.py rename to py/pdcopyist/src/core/Statement.py index 890a84a..5b5b0aa 100644 --- a/py/src/core/Statement.py +++ b/py/pdcopyist/src/core/Statement.py @@ -1,7 +1,7 @@ from typing import List -from .MethodCall import AndOperatorMethodCall, EqualOperatorMethodCall, GetItemMethodCall, MethodCall, OrOperatorMethodCall +from pdcopyist.src.core.MethodCall import AndOperatorMethodCall, EqualOperatorMethodCall, GetItemMethodCall, MethodCall, OrOperatorMethodCall class AbcStatement(object): diff --git a/py/src/cusFuns/__init__.py b/py/pdcopyist/src/core/__init__.py similarity index 100% rename from py/src/cusFuns/__init__.py rename to py/pdcopyist/src/core/__init__.py diff --git a/py/src/cusFuns/core/__init__.py b/py/pdcopyist/src/cusFuns/__init__.py similarity index 100% rename from py/src/cusFuns/core/__init__.py rename to py/pdcopyist/src/cusFuns/__init__.py diff --git a/py/src/cusFuns/columnNameChanger/index.py b/py/pdcopyist/src/cusFuns/columnNameChanger/index.py similarity index 67% rename from py/src/cusFuns/columnNameChanger/index.py rename to py/pdcopyist/src/cusFuns/columnNameChanger/index.py index c1290f5..953c555 100644 --- a/py/src/cusFuns/columnNameChanger/index.py +++ b/py/pdcopyist/src/cusFuns/columnNameChanger/index.py @@ -1,6 +1,6 @@ import importlib -from ..core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd @@ -13,4 +13,4 @@ def generate_code(*args, **kwargs): @dt_handle_func('修改列名') @dt_args(org_name=ty.ColumnSelect('待修改列:'), new_name=ty.Input('新列名:', placeholder='输入新的列名')) def change_column_name(df, org_name, new_name): - return df.rename(columns={org_name: new_name}) \ No newline at end of file + return df.rename(columns={org_name: new_name}) diff --git a/py/src/cusFuns/columnRemover/index.py b/py/pdcopyist/src/cusFuns/columnRemover/index.py similarity index 60% rename from py/src/cusFuns/columnRemover/index.py rename to py/pdcopyist/src/cusFuns/columnRemover/index.py index 7fe3a01..44c93c3 100644 --- a/py/src/cusFuns/columnRemover/index.py +++ b/py/pdcopyist/src/cusFuns/columnRemover/index.py @@ -1,5 +1,5 @@ -from ..core.DecoratorFuns import dt_handle_func, dt_args -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd diff --git a/py/src/cusFuns/core/Args.py b/py/pdcopyist/src/cusFuns/core/Args.py similarity index 97% rename from py/src/cusFuns/core/Args.py rename to py/pdcopyist/src/cusFuns/core/Args.py index 8cd130d..f38847a 100644 --- a/py/src/cusFuns/core/Args.py +++ b/py/pdcopyist/src/cusFuns/core/Args.py @@ -1,9 +1,9 @@ import pandas as pd -from ...core import Proxy +from pdcopyist.src.core import Proxy from typing import Callable, Iterable -from .UIModl import Content +from pdcopyist.src.cusFuns.core.UIModl import Content class AbcArgs(object): diff --git a/py/src/cusFuns/core/DecoratorFuns.py b/py/pdcopyist/src/cusFuns/core/DecoratorFuns.py similarity index 94% rename from py/src/cusFuns/core/DecoratorFuns.py rename to py/pdcopyist/src/cusFuns/core/DecoratorFuns.py index 36d49d4..fb525d8 100644 --- a/py/src/cusFuns/core/DecoratorFuns.py +++ b/py/pdcopyist/src/cusFuns/core/DecoratorFuns.py @@ -2,9 +2,9 @@ from typing import Any, Callable, List -from .UIModl import FunModel +from pdcopyist.src.cusFuns.core.UIModl import FunModel -from .Args import AbcArgs +from pdcopyist.src.cusFuns.core.Args import AbcArgs class CusFunsWrapper(object): diff --git a/py/src/cusFuns/core/FunsPool.py b/py/pdcopyist/src/cusFuns/core/FunsPool.py similarity index 96% rename from py/src/cusFuns/core/FunsPool.py rename to py/pdcopyist/src/cusFuns/core/FunsPool.py index d813fc9..a6f7633 100644 --- a/py/src/cusFuns/core/FunsPool.py +++ b/py/pdcopyist/src/cusFuns/core/FunsPool.py @@ -8,8 +8,8 @@ import inspect import os -from .DecoratorFuns import CusFunsWrapper, HandleWrapper -from .UIModl import FunModel +from pdcopyist.src.cusFuns.core.DecoratorFuns import CusFunsWrapper, HandleWrapper +from pdcopyist.src.cusFuns.core.UIModl import FunModel class CusFunc(object): diff --git a/py/src/cusFuns/core/UIModl.py b/py/pdcopyist/src/cusFuns/core/UIModl.py similarity index 96% rename from py/src/cusFuns/core/UIModl.py rename to py/pdcopyist/src/cusFuns/core/UIModl.py index bd08218..d6f31d0 100644 --- a/py/src/cusFuns/core/UIModl.py +++ b/py/pdcopyist/src/cusFuns/core/UIModl.py @@ -2,7 +2,7 @@ from typing import Dict, List -from ...helper.utils import CanJson +from pdcopyist.src.helper.utils import CanJson class Content(CanJson): diff --git a/py/pdcopyist/src/cusFuns/core/__init__.py b/py/pdcopyist/src/cusFuns/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/py/src/cusFuns/exportFile/index_csv.py b/py/pdcopyist/src/cusFuns/exportFile/index_csv.py similarity index 80% rename from py/src/cusFuns/exportFile/index_csv.py rename to py/pdcopyist/src/cusFuns/exportFile/index_csv.py index 5e6f61f..4a031eb 100644 --- a/py/src/cusFuns/exportFile/index_csv.py +++ b/py/pdcopyist/src/cusFuns/exportFile/index_csv.py @@ -1,5 +1,5 @@ -from ..core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd m_encoding = ['utf8', 'gb2312', 'gbk'] diff --git a/py/src/cusFuns/exportFile/index_excel.py b/py/pdcopyist/src/cusFuns/exportFile/index_excel.py similarity index 77% rename from py/src/cusFuns/exportFile/index_excel.py rename to py/pdcopyist/src/cusFuns/exportFile/index_excel.py index bf8d3e5..75dbad3 100644 --- a/py/src/cusFuns/exportFile/index_excel.py +++ b/py/pdcopyist/src/cusFuns/exportFile/index_excel.py @@ -1,5 +1,5 @@ -from ..core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd diff --git a/py/src/cusFuns/exportFile/index_feather.py b/py/pdcopyist/src/cusFuns/exportFile/index_feather.py similarity index 67% rename from py/src/cusFuns/exportFile/index_feather.py rename to py/pdcopyist/src/cusFuns/exportFile/index_feather.py index 105c764..088dbf4 100644 --- a/py/src/cusFuns/exportFile/index_feather.py +++ b/py/pdcopyist/src/cusFuns/exportFile/index_feather.py @@ -1,5 +1,5 @@ -from ..core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd diff --git a/py/src/cusFuns/typeChanger/index.py b/py/pdcopyist/src/cusFuns/typeChanger/index.py similarity index 80% rename from py/src/cusFuns/typeChanger/index.py rename to py/pdcopyist/src/cusFuns/typeChanger/index.py index 18503d4..9828d3f 100644 --- a/py/src/cusFuns/typeChanger/index.py +++ b/py/pdcopyist/src/cusFuns/typeChanger/index.py @@ -1,5 +1,5 @@ -from ..core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code -from ..core import Args as ty +from pdcopyist.src.cusFuns.core.DecoratorFuns import dt_handle_func, dt_args, dt_source_code +from pdcopyist.src.cusFuns.core import Args as ty import pandas as pd diff --git a/py/src/dataModel/pandasCmd.py b/py/pdcopyist/src/dataModel/pandasCmd.py similarity index 98% rename from py/src/dataModel/pandasCmd.py rename to py/pdcopyist/src/dataModel/pandasCmd.py index 2326284..001d2aa 100644 --- a/py/src/dataModel/pandasCmd.py +++ b/py/pdcopyist/src/dataModel/pandasCmd.py @@ -1,6 +1,6 @@ from enum import Enum from typing import Dict, List -from ..helper.utils import CanJson +from pdcopyist.src.helper.utils import CanJson import pandas as pd _m_ui_col_type_mapping = { diff --git a/py/src/helper/utils.py b/py/pdcopyist/src/helper/utils.py similarity index 100% rename from py/src/helper/utils.py rename to py/pdcopyist/src/helper/utils.py diff --git a/py/res.xlsx b/py/res.xlsx deleted file mode 100644 index 2a51d4f7cad675c837ac91e4f46bddb5f78fdd48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9871 zcmeHNg;!L2*B%-qq@+u_Te?9~x|HU3C)$0d#@Zz@^Zc8h)8boA; z6&GVtHBy-}Zeb*Q#u_o!u9LHV_hosetzUr&Wzu#WF=alMAS;_?HkOlFb>zM@)?_rt zE{HC3J(Rpwe*Z8ix6~lI3LN<$lMHu%AAO<*<5B&rCAS0p4LuXdgX%j1o6sYTFLEW} z((+6#>>I_%7t=eE{T;^0YHTmbEJZwD>u^!1E*Lg9Yx4^jFqWseQR{QZpGC6~S7d$uW4@zA z)|kHfq4uTOck!SxaFl+gCaejmoVIc?;|Cn}IOt0qIpd-rGqLkr>DcM+cPbmRd!yFRycc7FadkLBvAJFg((S9$df^hi>jN-m%< zD@d+J8LnS*-AJd;%-7{$Y3o!FQ2gVJngw;XG7Lx=NbL>T6c%va_~xj)wiUrPlo!q? zddO=@|Bj8cgluu)v50R}bryYI12JchY5w8N!ByQvjb02k8!Z64DHJL>-8(5M%QmQ z33l<$Tw8TmZPZNGH_(IUI^=E61NXyD88NNmDf3Yu>^{DOA~tt%qCW(i-b_Ia$ywah z?7sK91KBsQoOhft8{7AxdMJBBuP4Qj6M3my;PB^{sP=(t1x>~2vU4h%vW)EXcSk1nzRgkI zRn!=L{|%D4d6q7_*#Q!>=BEzJf!0q@wgd>UM-i%U#C_!lW?50W-&i!}rhS%cE?oH% z*i%*KO(ot&X#$UYIel6yKK%JI6Sqkr&6``N0sYIjPAShCrzyNci-r$nXA%#{sqSB! zx1GH{)JKn337b}DMONeLab{JgP$fMO@$i)I_w6nM=Cqe(yerJ}cQWM&^mE!28=yPs zTgZB5U*=kO&6(wetW&4!J9@X#T5Gf6>rQ7Ig026_=Rm3Wq+`UHMg*rR0GLP!KK~i_ z|HM-IV%%+SWZ5@!ncO;P(g=b-k1CiZllx#h!{9ny%um8th-wl zR9#m`m&*2R{iZ=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g8s7ykA%#HsA7KqP|e@}-`~gIJYu7z_HTfHkNf{N{CO-u zh~yu`|J#PQN1(q zg8%lxZ>zf7fVaz{Ux2Yxe*oSpihf%p-3I-4zW)UY0N~L80RNHwZ=3%+a{tr(HQhhV Z|BB;UYG?=!0suIO7c+v!x 0: -# if len(aggFs) == 1: -# ret.append(aggFs[0]) -# else: -# ret.append({'title': pre_topf, 'children': aggFs}) - -# for topf, field in get_each_field(df): - -# if topf != pre: -# _append_ret(aggFs, ret, pre) -# aggFs = [] - -# aggFs.append(field) -# pre = topf - -# _append_ret(aggFs, ret, pre) - -# return ret - - -# if __name__ == "__main__": -# df = pd.read_excel('data/test.xlsx') -# ret = df.groupby(['col1']).agg( -# {'col2': ['first', 'last'], 'col3': ['first']}) -# fields = columns2fields_obj(ret) -# print(fields) diff --git a/py/test.json b/py/test.json deleted file mode 100644 index 6fcc195..0000000 --- a/py/test.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "_id": "90a1e608-435c-11eb-8471-c858c009ba5f", - "code": "#\u5bfc\u5165\u6a21\u5757\nimport pandas as pd", - "hasError": false, - "name": "\u5bfc\u5165\u6a21\u5757" - }, - { - "_id": "90a1e609-435c-11eb-a701-c858c009ba5f", - "code": "#\u52a0\u8f7d\u6570\u636e\ndf = pd.read_excel('data.xlsx',sheet_name = 0,header = 0,engine = 'openpyxl')", - "hasError": false, - "name": "\u52a0\u8f7d\u6570\u636e" - }, - { - "_id": "90a53f0c-435c-11eb-a0d2-c858c009ba5f", - "code": "#\u8868\u5934\u7edf\u4e00\u8f6c\u6587\u672c\ncols = [str(c) for c in df.columns]\ndf.columns=cols", - "hasError": false, - "name": "\u8868\u5934\u7edf\u4e00\u8f6c\u6587\u672c" - }, - { - "_id": "9b7d53e2-435c-11eb-8fc1-c858c009ba5f", - "code": "#None\ndef change_column_name(df: pd.DataFrame, org_name: str, new_name: str) -> pd.DataFrame: return df.rename(columns={org_name: new_name})\ndf = change_column_name(df,*(),**{'org_name': 'sex', 'new_name': 'dfdfd'})", - "hasError": true, - "name": null - } -] \ No newline at end of file diff --git a/py/test.py b/py/test.py deleted file mode 100644 index 29249ca..0000000 --- a/py/test.py +++ /dev/null @@ -1,6 +0,0 @@ - -# %% -import pathlib - -pathlib.Path('build/build.bat').name -# %% diff --git a/py/test_func.py b/py/test_func.py deleted file mode 100644 index fe9d6f5..0000000 --- a/py/test_func.py +++ /dev/null @@ -1,11 +0,0 @@ - - -def funA(a, b): - return a+b - - -def change_column_name(df, org_name: str, new_name: str): - """ - docstring - """ - pass diff --git a/py/testing/Commander_test.py b/py/testing/Commander_test.py index 51680af..69792fe 100644 --- a/py/testing/Commander_test.py +++ b/py/testing/Commander_test.py @@ -1,7 +1,7 @@ import unittest -from src.core.Commander import Commander, MethodCall, Statement +from pdcopyist.src.core import Commander, MethodCall, Statement class CommanderTest(unittest.TestCase): diff --git a/py/testing/Model_test.py b/py/testing/Model_test.py index 0425cf9..53bc1ab 100644 --- a/py/testing/Model_test.py +++ b/py/testing/Model_test.py @@ -1,7 +1,7 @@ import unittest -from src.dataModel.pandasCmd import PandasCmd +from pdcopyist.src.dataModel.pandasCmd import PandasCmd class PandasCmd2modelTest(unittest.TestCase): diff --git a/py/testing/Proxy_test.py b/py/testing/Proxy_test.py index d1731b8..2b9a78c 100644 --- a/py/testing/Proxy_test.py +++ b/py/testing/Proxy_test.py @@ -1,8 +1,8 @@ import unittest -from src.core.Commander import Commander +from pdcopyist.src.core.Commander import Commander -from src.core.Proxy import CallerProxy, DataFrameProxy, PandasProxy +from pdcopyist.src.core.Proxy import CallerProxy import pandas as pd diff --git a/ui/package.json b/ui/package.json index 36dd51d..b34ac13 100644 --- a/ui/package.json +++ b/ui/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build_watch_toPy": "vue-cli-service build --dest ../py/web --mode production", + "build_watch_toPy": "vue-cli-service build --dest ../py/pdcopyist/web --mode production", "lint": "vue-cli-service lint" }, "dependencies": { @@ -35,4 +35,4 @@ "last 2 versions", "not dead" ] -} +} \ No newline at end of file -- Gitee