diff --git a/.gitignore b/.gitignore index 41507139288f67c2dece2857678627bf55a9c5be..1b79c37db3ba91096aa4f493111d8e669c36e7ba 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 e97edf1f745522926581de2da2bff17091ae7074..0000000000000000000000000000000000000000 --- 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 74198e956a7eb9b29567730a228712e4362b19db..f6845a9eb0581f5b4c0ecfdbd0a7dd42319d5d4f 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 0000000000000000000000000000000000000000..4ab32f6fd8fcf09d29dc3251aa599f3f1e2038a2 --- /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 62c637769b568bb57827f5e27411c41e2628ce82..f1cd88d8248f56cd36311034fe41f0d78505369b 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 1af5578885a279474518ac9f2cb7ebfdcfac7bc6..47de6de41d37033421580f3477afdbdadedd32b1 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 9bd570061e3e2b45b0d2515fa8ee4efb32e92c49..1d09707b74a9d623382d50ab0fe8ca1faf93dd4d 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 39e7a6b0ebc45807edbe02c2c25007f3f673c960..7ee817406bf53579570533b30d8fbedd34d0ed9f 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 5fbcba1f8f0e31cf536afbd7cc7863d12a3e0132..f8857eab32015c3ad0cd38fcbade24e0e66bd488 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 8c2346b359c32e4c0f9898dbff5a444e75f70725..aecabde2d2e9c51dcac68f54fc18649a6957117a 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 7a682f758310b27fd48714b1825451982824779a..0f7912b8d4392d499e63c103f7143c0cf081d8b8 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 44926dec56184cb4134f0246cdd50073cb32c4a0..0fa0ef97c8938424eb5ff3af3b1c62d4775cd07b 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 814740d1d879c503b6dac910ea7f3b7daf690fda..03d2ddf3c37606e700ade7928993b72a9eaf5a16 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 3eba3bc4d8433b835c30433d6915dbb9b091557b..889be3a4eb8974f4f7309f14749ab1336b111ddd 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 d904fbb9b93bde858c014f62d1e7af476bac21d8..383b2f4114f840e41fbafef35fd800f0be1bd9cd 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 890a84a41647572b591cbc3fa38b64ed66e76fe0..5b5b0aa4a626d769d53f7a825a4733aa8ec446bb 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 c1290f5eb108139c83d92dea789e2f1b16000526..953c555fdecf85010b25fe106c4c65c191fc4f36 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 7fe3a0117d072bf4047adb50faa10cc890bb934f..44c93c3762c665a7373480373aa919ba4af0895b 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 8cd130d8859d25d749307616f0879cef21e387b5..f38847a467789b3f9a2adfdb00932f8244fb2e46 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 36d49d4712c12fb6178ee4b33b6b6785873a8eec..fb525d80c3b424a4539e6580720b8516caff6811 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 d813fc9bd529d28eeedd8c3032bb35b865add191..a6f7633a1d6d861cb652e2a4ef42b20f9ad2e6a4 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 bd08218368248bb5c231669df32cbd7b103e618c..d6f31d08fc4ccc6d6a1a5f3d86fc4956b5e5632d 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 5e6f61f4d77808aad0d11d6d18183b81abe0adec..4a031ebb4f62b9cc16703361643f285b648371cf 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 bf8d3e5f2eb79574c978933e9b5706e345508d17..75dbad357c0a4c09ee8a3a9b83e750706bda32ad 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 105c764680771bfdf0ef563e6eedd0eed00106ea..088dbf4dcf63a38b03bac0fe6464946992ceb281 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 18503d4214abd798a0e7ffeea364ca8df35c7b6d..9828d3fccd2b187ef8f94c56b7fe3ce6490fae99 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 2326284fb1c291d71e2a947cd848c3b4e3a3e4ee..001d2aae01b17a43ec56c45ea222fee00f4a2deb 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 Binary files a/py/res.xlsx and /dev/null differ diff --git a/py/src/core/__init__.py b/py/src/core/__init__.py deleted file mode 100644 index 65619441657c766a12d0980be06825a86475a149..0000000000000000000000000000000000000000 --- a/py/src/core/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ - - - -from .Proxy import ProxyManager \ No newline at end of file diff --git a/py/src/helper/data2model.py b/py/src/helper/data2model.py deleted file mode 100644 index a964bdb932398cd26e0c75971ae502d4e194a364..0000000000000000000000000000000000000000 --- a/py/src/helper/data2model.py +++ /dev/null @@ -1,74 +0,0 @@ - -# import pandas as pd - - -# def to_col_type(org_type): -# mapping = { -# 'object': 'str', -# 'int': 'number', -# 'int64': 'number', -# 'int32': 'number', -# } - -# stype = str(org_type) - -# return mapping[stype] - - -# def get_each_field(df: pd.DataFrame): - -# for c, t in zip(df.columns, df.dtypes): -# field = c -# topF = c -# if isinstance(c, tuple): -# field = '_'.join(c) -# topF = c[0] - -# yield topF, { -# 'title': f'{field}[{str(t)}]', -# 'field': field, 'type': to_col_type(t), -# 'filters': [] -# } - - -# def flat_cols(cols): -# return [ -# '_'.join(c) if isinstance(c, tuple) else c -# for c in cols -# ] - - -# def columns2fields_obj(df: pd.DataFrame): - -# count = 0 -# pre = None -# ret = [] -# aggFs = [] - -# def _append_ret(aggFs, ret, pre_topf): -# if len(aggFs) > 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 6fcc1951e8134bdfa7c48ed5827a23469921d2a9..0000000000000000000000000000000000000000 --- 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 29249ca439fb6942a51a2904e6c5953455da7665..0000000000000000000000000000000000000000 --- 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 fe9d6f5c92a06eb0884f0e500f3d4d8a5d3f6785..0000000000000000000000000000000000000000 --- 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 51680aff77d3909e252fd96b7a3724cfb27db8dd..69792fe0fd41113b79b20414c98fcb9c48704753 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 0425cf9fce569c3970be3735a568e65adccde510..53bc1ab279ae56c62502abfb5ba9deb2159282fa 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 d1731b8100f6317e0d559a2fe3b3d383f143d374..2b9a78c8f02a032c802e30997b387c8986fa5df0 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 36dd51db407e2d0d4f6f4763a8cf9c210139eeb1..b34ac13363427252c2c7038c7c6ffcb4079bdc13 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