KL-Py 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kl_py-0.3.3 → kl_py-0.3.4}/PKG-INFO +1 -1
- {kl_py-0.3.3 → kl_py-0.3.4}/pyproject.toml +1 -1
- kl_py-0.3.4/src/KL_Py/_custom_sqlite.py +345 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/_translate.py +164 -52
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py.egg-info/PKG-INFO +1 -1
- kl_py-0.3.3/src/KL_Py/_custom_sqlite.py +0 -72
- {kl_py-0.3.3 → kl_py-0.3.4}/LICENSE +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/README.md +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/setup.cfg +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/_utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/base.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/button.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/calendar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/canvas.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/checkbox.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/column.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/combo.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/error.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/frame.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/graph.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/helpers.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/image.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/input.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/list_box.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/menu.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/multiline.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/option_menu.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/pane.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/progress_bar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/radio.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/separator.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/sizegrip.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/slider.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/spin.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/status_bar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/stretch.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/tab.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/table.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/text.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/elements/tree.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/themes.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/tray.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/FreeSimpleGUI/window.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/KL_Py.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/_custom_pandas.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/_custom_turtle.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/_error_classes.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/_klang_builtins.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/automl.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/dnd/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/drag_and_drop/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/export/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/fsgdnd/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/fsgui/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/_utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/base.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/button.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/calendar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/canvas.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/center.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/checkbox.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/column.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/combo.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/error.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/frame.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/graph.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/helpers.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/image.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/input.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/list_box.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/menu.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/multiline.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/option_menu.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/pane.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/progress_bar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/radio.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/separator.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/sizegrip.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/slider.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/spin.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/status_bar.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/stretch.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/tab.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/table.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/text.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/elements/tree.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/replace.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/tray.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/hindGui/window.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/k2exe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kexe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/kl2exe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klang2exe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klangexe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/klexe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/ml.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/np/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pd/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/plt/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/psgui/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/px/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pyexe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/pysgdnd/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/__version__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/_internal_utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/adapters.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/api.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/auth.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/certifi/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/certifi/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/certifi/core.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/certifi/py.typed +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/certs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/api.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/cd.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/cli/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/cli/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/constant.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/legacy.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/md.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/models.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/py.typed +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/charset_normalizer/version.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/compat.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/cookies.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/exceptions.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/help.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/hooks.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/codec.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/compat.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/core.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/idnadata.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/intranges.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/package_data.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/py.typed +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/idna/uts46data.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/models.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/packages.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/sessions.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/status_codes.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/structures.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/_base_connection.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/_collections.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/_request_methods.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/_version.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/connection.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/connectionpool.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/emscripten/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/emscripten/connection.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/emscripten/fetch.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/emscripten/request.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/emscripten/response.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/pyopenssl.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/contrib/socks.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/exceptions.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/fields.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/filepost.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/http2/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/http2/connection.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/http2/probe.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/poolmanager.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/py.typed +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/response.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/connection.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/proxy.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/request.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/response.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/retry.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/ssl_.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/ssl_match_hostname.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/ssltransport.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/timeout.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/url.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/util.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/urllib3/util/wait.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/requests/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/sb/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/sk/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/sns/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/__init__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/__main__.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/config.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/dialogs.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/packaging.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/shims.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/ui.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/utils.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/toexe/validation.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py/when.py +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py.egg-info/SOURCES.txt +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py.egg-info/dependency_links.txt +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py.egg-info/requires.txt +0 -0
- {kl_py-0.3.3 → kl_py-0.3.4}/src/KL_Py.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
from .KL_Py import *
|
|
2
|
+
from KL_Py import KL_Py
|
|
3
|
+
import sqlite3 as sql
|
|
4
|
+
from ._translate import translate_for_sql
|
|
5
|
+
|
|
6
|
+
class SQL:
|
|
7
|
+
def __init__(
|
|
8
|
+
self,
|
|
9
|
+
filename: str = "test",
|
|
10
|
+
db: str = None,
|
|
11
|
+
errors: bool = False,
|
|
12
|
+
warnings: bool = True
|
|
13
|
+
):
|
|
14
|
+
self.conn = None
|
|
15
|
+
self.cursor = None
|
|
16
|
+
errors = str(errors)\
|
|
17
|
+
.lower() in (
|
|
18
|
+
"true",
|
|
19
|
+
"yes",
|
|
20
|
+
"show"
|
|
21
|
+
)
|
|
22
|
+
self.errors = errors
|
|
23
|
+
warnings = str(warnings)\
|
|
24
|
+
.lower() in (
|
|
25
|
+
"true",
|
|
26
|
+
"yes",
|
|
27
|
+
"show"
|
|
28
|
+
)
|
|
29
|
+
filename = db\
|
|
30
|
+
if isinstance(db, str)\
|
|
31
|
+
and str(db).strip()\
|
|
32
|
+
else filename
|
|
33
|
+
filename = str(filename)\
|
|
34
|
+
if filename is not None\
|
|
35
|
+
else "test"
|
|
36
|
+
if filename != ":memory:":
|
|
37
|
+
if not filename.endswith(".db"):
|
|
38
|
+
filename += ".db"
|
|
39
|
+
if not os.path.exists(
|
|
40
|
+
filename
|
|
41
|
+
):
|
|
42
|
+
print(
|
|
43
|
+
f"Info:\n\tNo such database file:"\
|
|
44
|
+
+ f"\n\t\t{filename!r}."\
|
|
45
|
+
+ "\n\tCreating one from scratch..."
|
|
46
|
+
)
|
|
47
|
+
try:
|
|
48
|
+
self.conn = sql.connect(
|
|
49
|
+
filename
|
|
50
|
+
)
|
|
51
|
+
self.cursor = self\
|
|
52
|
+
.conn\
|
|
53
|
+
.cursor()
|
|
54
|
+
except Exception as e:
|
|
55
|
+
if errors:
|
|
56
|
+
raise
|
|
57
|
+
if warnings:
|
|
58
|
+
print(
|
|
59
|
+
f"Warning:\n\t"\
|
|
60
|
+
+ "Failed to connect"\
|
|
61
|
+
+ "\n\tto the database."\
|
|
62
|
+
+ f"\n\tReason:\n\t\t{e}"\
|
|
63
|
+
+ "\n\n\tJust a silent\n\t"\
|
|
64
|
+
+ "warning before automated\n\t"\
|
|
65
|
+
+ "termination.\n\tUse errors=True"\
|
|
66
|
+
+ "\n\tto throw."
|
|
67
|
+
)
|
|
68
|
+
@classmethod
|
|
69
|
+
def connect(
|
|
70
|
+
cls,
|
|
71
|
+
*args,
|
|
72
|
+
**kwargs
|
|
73
|
+
) -> Self:
|
|
74
|
+
return cls(
|
|
75
|
+
*args,
|
|
76
|
+
**kwargs
|
|
77
|
+
)
|
|
78
|
+
conn = connect
|
|
79
|
+
def execute(
|
|
80
|
+
self,
|
|
81
|
+
command: str,
|
|
82
|
+
errors: bool = False,
|
|
83
|
+
warnings: bool = True,
|
|
84
|
+
fetch: int = -1,
|
|
85
|
+
f=None,
|
|
86
|
+
max_=None,
|
|
87
|
+
only=None,
|
|
88
|
+
sirf=None,
|
|
89
|
+
*args,
|
|
90
|
+
**kwargs
|
|
91
|
+
) ->\
|
|
92
|
+
Union[
|
|
93
|
+
list[
|
|
94
|
+
tuple[
|
|
95
|
+
Any,
|
|
96
|
+
]
|
|
97
|
+
],
|
|
98
|
+
tuple[
|
|
99
|
+
Any,
|
|
100
|
+
],
|
|
101
|
+
Self
|
|
102
|
+
]:
|
|
103
|
+
fetch = f\
|
|
104
|
+
or max_\
|
|
105
|
+
or only\
|
|
106
|
+
or sirf\
|
|
107
|
+
or fetch
|
|
108
|
+
if isinstance(
|
|
109
|
+
fetch,
|
|
110
|
+
float
|
|
111
|
+
):
|
|
112
|
+
fetch = int(
|
|
113
|
+
fetch
|
|
114
|
+
)
|
|
115
|
+
if not isinstance(
|
|
116
|
+
fetch,
|
|
117
|
+
int
|
|
118
|
+
):
|
|
119
|
+
fetch = -1
|
|
120
|
+
errors = str(errors)\
|
|
121
|
+
.lower() in (
|
|
122
|
+
"true",
|
|
123
|
+
"yes",
|
|
124
|
+
"show"
|
|
125
|
+
)
|
|
126
|
+
errors = errors or self.errors
|
|
127
|
+
warnings = str(warnings)\
|
|
128
|
+
.lower() in (
|
|
129
|
+
"true",
|
|
130
|
+
"yes",
|
|
131
|
+
"show"
|
|
132
|
+
)
|
|
133
|
+
warnings = warnings
|
|
134
|
+
if not (
|
|
135
|
+
self.conn\
|
|
136
|
+
and self.cursor\
|
|
137
|
+
and isinstance(
|
|
138
|
+
command,
|
|
139
|
+
str
|
|
140
|
+
)\
|
|
141
|
+
and str(
|
|
142
|
+
command
|
|
143
|
+
).strip()
|
|
144
|
+
)\
|
|
145
|
+
and not errors:
|
|
146
|
+
if warnings:
|
|
147
|
+
print(
|
|
148
|
+
"Warning:\n\tNot connected to the database,"\
|
|
149
|
+
+ "\n\tor invalid SQL command syntax."\
|
|
150
|
+
+ "\n\n\tJust a silent\n\t"\
|
|
151
|
+
+ "warning before automated\n\t"\
|
|
152
|
+
+ "termination.\n\tUse errors=True"\
|
|
153
|
+
+ "\n\tto throw."
|
|
154
|
+
)
|
|
155
|
+
return self
|
|
156
|
+
try:
|
|
157
|
+
command = command\
|
|
158
|
+
.strip()
|
|
159
|
+
translated_command: str = translate_for_sql(
|
|
160
|
+
command
|
|
161
|
+
)
|
|
162
|
+
self.cursor.execute(
|
|
163
|
+
translated_command,
|
|
164
|
+
*args,
|
|
165
|
+
**kwargs
|
|
166
|
+
)
|
|
167
|
+
self.conn.commit()
|
|
168
|
+
if self.cursor\
|
|
169
|
+
and callable(
|
|
170
|
+
getattr(
|
|
171
|
+
self.cursor,
|
|
172
|
+
"fetchall"
|
|
173
|
+
)
|
|
174
|
+
)\
|
|
175
|
+
and "select"\
|
|
176
|
+
in translated_command\
|
|
177
|
+
.lower():
|
|
178
|
+
results: list = self.cursor\
|
|
179
|
+
.fetchall()
|
|
180
|
+
if results\
|
|
181
|
+
and 0 <= fetch <= len(results):
|
|
182
|
+
results_sliced = results[
|
|
183
|
+
:fetch
|
|
184
|
+
]
|
|
185
|
+
if len(results_sliced)\
|
|
186
|
+
== 1:
|
|
187
|
+
results_sliced =\
|
|
188
|
+
results_sliced[
|
|
189
|
+
0
|
|
190
|
+
]
|
|
191
|
+
return results_sliced
|
|
192
|
+
return results
|
|
193
|
+
return self
|
|
194
|
+
except Exception as e:
|
|
195
|
+
if errors:
|
|
196
|
+
raise
|
|
197
|
+
err_msg: str = str(e)
|
|
198
|
+
if "unique constraint failed" in err_msg\
|
|
199
|
+
.lower():
|
|
200
|
+
# this message is thrown
|
|
201
|
+
# when you add a duplicate
|
|
202
|
+
# value
|
|
203
|
+
# to a column
|
|
204
|
+
# with
|
|
205
|
+
# "UNIQUE"
|
|
206
|
+
# constraint
|
|
207
|
+
err_msg = ""
|
|
208
|
+
if warnings\
|
|
209
|
+
and err_msg:
|
|
210
|
+
print(
|
|
211
|
+
"Warning:\n\t"\
|
|
212
|
+
+ f"Suppressed"\
|
|
213
|
+
+ "\n\tSQL Error"\
|
|
214
|
+
+ "\n\ton execution:\n\t\t"\
|
|
215
|
+
+ f"{err_msg}\n\t\n\t"\
|
|
216
|
+
+ f"Inside Query:\n\t\t"\
|
|
217
|
+
+ translated_command\
|
|
218
|
+
+ "\n\n\tJust a silent\n\t"\
|
|
219
|
+
+ "warning before automated\n\t"\
|
|
220
|
+
+ "termination.\n\tUse errors=True"\
|
|
221
|
+
+ "\n\tto throw."
|
|
222
|
+
)
|
|
223
|
+
return self
|
|
224
|
+
apply =\
|
|
225
|
+
karo =\
|
|
226
|
+
apply_karo =\
|
|
227
|
+
do =\
|
|
228
|
+
run =\
|
|
229
|
+
exec =\
|
|
230
|
+
execute
|
|
231
|
+
def drop(
|
|
232
|
+
self,
|
|
233
|
+
table_name: str
|
|
234
|
+
) -> Self:
|
|
235
|
+
if not (
|
|
236
|
+
isinstance(table_name, str)\
|
|
237
|
+
and table_name\
|
|
238
|
+
.strip()
|
|
239
|
+
):
|
|
240
|
+
return self
|
|
241
|
+
table_name = table_name\
|
|
242
|
+
.strip()
|
|
243
|
+
drop_command: str = f"girao table agar mojud "+\
|
|
244
|
+
table_name
|
|
245
|
+
return self.execute(
|
|
246
|
+
drop_command
|
|
247
|
+
)
|
|
248
|
+
giraao =\
|
|
249
|
+
girao =\
|
|
250
|
+
drop
|
|
251
|
+
def clear(
|
|
252
|
+
self,
|
|
253
|
+
table_name: str
|
|
254
|
+
) -> Self:
|
|
255
|
+
if not (
|
|
256
|
+
isinstance(table_name, str)\
|
|
257
|
+
and table_name\
|
|
258
|
+
.strip()
|
|
259
|
+
):
|
|
260
|
+
return self
|
|
261
|
+
table_name = table_name\
|
|
262
|
+
.strip()
|
|
263
|
+
clear_command: str = f"saaf karo "+\
|
|
264
|
+
table_name
|
|
265
|
+
return self.execute(
|
|
266
|
+
clear_command,
|
|
267
|
+
warnings=False
|
|
268
|
+
)
|
|
269
|
+
saf =\
|
|
270
|
+
saf_karo =\
|
|
271
|
+
saaf =\
|
|
272
|
+
saaf_karo =\
|
|
273
|
+
clean =\
|
|
274
|
+
clear
|
|
275
|
+
def __call__(
|
|
276
|
+
self,
|
|
277
|
+
*args,
|
|
278
|
+
**kwargs
|
|
279
|
+
) ->\
|
|
280
|
+
Union[
|
|
281
|
+
list[
|
|
282
|
+
tuple[
|
|
283
|
+
Any,
|
|
284
|
+
]
|
|
285
|
+
],
|
|
286
|
+
tuple[
|
|
287
|
+
Any,
|
|
288
|
+
],
|
|
289
|
+
Self
|
|
290
|
+
]:
|
|
291
|
+
return self.execute(
|
|
292
|
+
*args,
|
|
293
|
+
**kwargs
|
|
294
|
+
)
|
|
295
|
+
def __enter__(
|
|
296
|
+
self
|
|
297
|
+
):
|
|
298
|
+
return self
|
|
299
|
+
def __exit__(
|
|
300
|
+
self,
|
|
301
|
+
*args,
|
|
302
|
+
**kwargs
|
|
303
|
+
):
|
|
304
|
+
return False
|
|
305
|
+
DB =\
|
|
306
|
+
Db =\
|
|
307
|
+
db_conn =\
|
|
308
|
+
dbconn =\
|
|
309
|
+
db_connect =\
|
|
310
|
+
sql_conn =\
|
|
311
|
+
sqlconn =\
|
|
312
|
+
sql_connect =\
|
|
313
|
+
db = SQL
|
|
314
|
+
|
|
315
|
+
"""
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def main() -> None:
|
|
319
|
+
with Db("test2") as db:
|
|
320
|
+
#db("saaf karo Users")
|
|
321
|
+
#db("girao table users")
|
|
322
|
+
query = "BANAO Table agar na mojud Users jisme mojud (id int khas a+, name jumla? nahi_to 'Anonymous' alheda, age int | 0 mukhtalif, color jumla | 'white')"
|
|
323
|
+
db(query)
|
|
324
|
+
db(
|
|
325
|
+
"`users` me dalo (name, age): ('Jackson', 21)"
|
|
326
|
+
)(
|
|
327
|
+
"dalo darmyan `users` (name, age) inhe ('Becky', 22), ('Dammy', 29)"
|
|
328
|
+
)
|
|
329
|
+
db('''badlo Users
|
|
330
|
+
naya name he 'Jack',
|
|
331
|
+
aur age he 27,
|
|
332
|
+
aur color he 'black'
|
|
333
|
+
jaha name he 'Jackson'
|
|
334
|
+
'''
|
|
335
|
+
)
|
|
336
|
+
results = db(
|
|
337
|
+
"chuno mukhtlf Name Users mese jahan Name me he 'a'",
|
|
338
|
+
sirf=1
|
|
339
|
+
)
|
|
340
|
+
print(results)
|
|
341
|
+
|
|
342
|
+
if __name__ == "__main__":
|
|
343
|
+
main()
|
|
344
|
+
|
|
345
|
+
"""
|
|
@@ -127,7 +127,7 @@ def translate_for_jupyter(code: str) -> None:
|
|
|
127
127
|
r"kaho": "print",
|
|
128
128
|
# match-case
|
|
129
129
|
r"aga?r[_ ]match(?= [^\n\t\:]+\:)": "match",
|
|
130
|
-
r"(?<=(?<!\w) {2})sath(?! (?:open|khola|[A-Za-z_]\w
|
|
130
|
+
r"(?<=(?<!\w) {2})sath(?! (?:open|khola|(?:[Ss][Qq][Ll]|[Dd][Bb])(?:(?:\.| k[aeio] )conn(?:ect)?)?|[A-Za-z_]\w*(?:\.| k[aeio] )conn(?:ect)?) *\()": "case",
|
|
131
131
|
# same keyword, different operations
|
|
132
132
|
# keep the sequence untouched
|
|
133
133
|
r"sath(?= [A-Za-z_])": "with",
|
|
@@ -1508,34 +1508,44 @@ def translate_for_sql(text: str) -> str:
|
|
|
1508
1508
|
or not str(text).strip():
|
|
1509
1509
|
return ""
|
|
1510
1510
|
dictionary: dict[str, str] = {
|
|
1511
|
-
"bana{1,2}o": "create",
|
|
1512
|
-
"chuno": "select",
|
|
1513
|
-
"badlo": "update",
|
|
1514
|
-
"rakho": "set",
|
|
1515
|
-
"
|
|
1516
|
-
|
|
1517
|
-
|
|
1511
|
+
r"bana{1,2}o": "create",
|
|
1512
|
+
r"chuno": "select",
|
|
1513
|
+
r"badlo": "update",
|
|
1514
|
+
r"rakho|nay?[ai]|ab": "set",
|
|
1515
|
+
r"nahi[_ *]to|def|shurwat(?:i|[_ ]*me)": "default",
|
|
1516
|
+
# similar key different
|
|
1517
|
+
# functionality these 2:
|
|
1518
|
+
# comes before
|
|
1519
|
+
r"(?:al(?:ag|heda)|uni?que?|mukhta?li?f)(?= *[\w\(\*])": "distinct",
|
|
1520
|
+
# comes after:
|
|
1521
|
+
r"(?:al(?:ag|heda)|uni?que?|mukhta?li?f)": "unique",
|
|
1522
|
+
# SEQUENCE IS
|
|
1523
|
+
# IMPORTANT
|
|
1524
|
+
# different from primary key
|
|
1525
|
+
# that one's for keys like 'ID'
|
|
1526
|
+
r"nazaria|alias": "view",
|
|
1527
|
+
r"da{1,2}lo": "insert",
|
|
1518
1528
|
# duplicate replacement
|
|
1519
1529
|
# but for flexibility
|
|
1520
1530
|
# * stays untouched
|
|
1521
1531
|
# otherwise flexibility goes away
|
|
1522
1532
|
# do NOT remove ^
|
|
1523
|
-
"darmya{1,2}n|b(?:i|ee)ch": "into",
|
|
1524
|
-
"sab(?:[_ ]?kuch)?": "*",
|
|
1533
|
+
r"darmya{1,2}n|b(?:i|ee)ch": "into",
|
|
1534
|
+
r"sab(?:[_ ]?kuch)?": "*",
|
|
1525
1535
|
r"jaha{1,2}n?": "where",
|
|
1526
1536
|
r"sirf(?= \d)": "limit",
|
|
1527
|
-
'bar[ai](?: he)?[_ ]ya[_ ]ba?ra{0,2}ba?r(?: he)?': '>=',
|
|
1528
|
-
'chot[ai](?: he)?[_ ]ya[_ ]ba?ra{0,2}ba?r(?: he)?': '<=',
|
|
1529
|
-
'bar[ai](?: he)?': '>',
|
|
1530
|
-
'chot[ai](?: he)?': '<',
|
|
1531
|
-
'(?<=,|(?<=,) )aur': '',
|
|
1532
|
-
'aur': 'and',
|
|
1533
|
-
'ya': 'or',
|
|
1534
|
-
"nahi(?! moj(?:u|oo)d)(?: (?:ba?ra{0,2}ba?r )?he)?": "!=",
|
|
1535
|
-
"(?:ba?ra{0,2}ba?r )?he": "=",
|
|
1537
|
+
r'bar[ai](?: he)?[_ ]ya[_ ]ba?ra{0,2}ba?r(?: he)?': '>=',
|
|
1538
|
+
r'chot[ai](?: he)?[_ ]ya[_ ]ba?ra{0,2}ba?r(?: he)?': '<=',
|
|
1539
|
+
r'bar[ai](?: he)?': '>',
|
|
1540
|
+
r'chot[ai](?: he)?': '<',
|
|
1541
|
+
r'(?<=,|(?<=,) )aur': '',
|
|
1542
|
+
r'aur': 'and',
|
|
1543
|
+
r'ya': 'or',
|
|
1544
|
+
r"nahi(?! moj(?:u|oo)d)(?: (?:ba?ra{0,2}ba?r )?he)?": "!=",
|
|
1545
|
+
r"(?:ba?ra{0,2}ba?r )?he": "=",
|
|
1536
1546
|
# sequence matters
|
|
1537
|
-
"gira{1,2}o": "drop",
|
|
1538
|
-
"(?:clea[rn]|sa{1,2}f|kha{1,2}li)[_ ]*(?:karo|table)(?:[_ ]*table)?": "delete from",
|
|
1547
|
+
r"gira{1,2}o": "drop",
|
|
1548
|
+
r"(?:clea[rn]|sa{1,2}f|kha{1,2}li)[_ ]*(?:karo|table)(?:[_ ]*table)?": "delete from",
|
|
1539
1549
|
r"agar(?! *\()": "if",
|
|
1540
1550
|
# has more priority
|
|
1541
1551
|
# than agar( -> IIF
|
|
@@ -1555,28 +1565,80 @@ def translate_for_sql(text: str) -> str:
|
|
|
1555
1565
|
# chuno name, agar(age >= 18, 'Adult', 'Minor')
|
|
1556
1566
|
# tor users_age_ranked
|
|
1557
1567
|
# users mese
|
|
1558
|
-
"na(?:hi)?(?= moj(?:u|oo)d)": "not",
|
|
1559
|
-
"tor": "as",
|
|
1560
|
-
"sath": "with",
|
|
1561
|
-
"
|
|
1568
|
+
r"na(?:hi)?(?= moj(?:u|oo)d)": "not",
|
|
1569
|
+
r"tor": "as",
|
|
1570
|
+
r"sath": "with",
|
|
1571
|
+
r"i(?:nh|s)e|vals?": "values",
|
|
1562
1572
|
# sequence matters
|
|
1563
|
-
"moj(?:u|oo)d": "exists",
|
|
1573
|
+
r"moj(?:u|oo)d": "exists",
|
|
1564
1574
|
# data types
|
|
1565
|
-
"(?:str|jumla|lafz|text)(?: not null)?": "text not null",
|
|
1566
|
-
"bint(?: not null)?": "bigint not null",
|
|
1567
|
-
"int(?: not null)?": "integer not null",
|
|
1568
|
-
"(?:fl(?:oa)?t|nr)(?: not null)?": "real not null",
|
|
1569
|
-
"(?:bool|haal)(?: not null)?": "integer default 0 not null",
|
|
1570
|
-
"[Ss]ach|[Hh]an": "true",
|
|
1571
|
-
"[Jj]hoot|[Nn]ahi": "false",
|
|
1572
|
-
"kha{1,2}s": "primary key",
|
|
1573
|
-
"istama{1,2}l(?: db)?": "use",
|
|
1574
|
-
"db": "database",
|
|
1575
|
+
r"(?:str|jumla|lafz|text)(?: not null)?": "text not null",
|
|
1576
|
+
r"bint(?: not null)?": "bigint not null",
|
|
1577
|
+
r"int(?: not null)?": "integer not null",
|
|
1578
|
+
r"(?:fl(?:oa)?t|nr)(?: not null)?": "real not null",
|
|
1579
|
+
r"(?:bool|haal)(?: not null)?": "integer default 0 not null",
|
|
1580
|
+
r"[Ss]ach|[Hh]an": "true",
|
|
1581
|
+
r"[Jj]hoot|[Nn]ahi": "false",
|
|
1582
|
+
r"kha{1,2}s": "primary key",
|
|
1583
|
+
r"istama{1,2}l(?: db)?": "use",
|
|
1584
|
+
r"db": "database",
|
|
1575
1585
|
}
|
|
1576
|
-
translation: str = text
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1586
|
+
translation: str = text\
|
|
1587
|
+
.lower()\
|
|
1588
|
+
.strip()\
|
|
1589
|
+
.rstrip(";")
|
|
1590
|
+
strings_and_column_names: list[str] = re.findall(
|
|
1591
|
+
"[`\"\'][^`\"\']*[`\"\']",
|
|
1592
|
+
translation
|
|
1593
|
+
)
|
|
1594
|
+
translation = replacei(
|
|
1595
|
+
translation,
|
|
1596
|
+
r"\bshuru[ _]*me *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1597
|
+
"like '$match%'"
|
|
1598
|
+
)
|
|
1599
|
+
translation = replacei(
|
|
1600
|
+
translation,
|
|
1601
|
+
r"\bshuru[ _]*me[ _]*nahi *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1602
|
+
"not like '$match%'"
|
|
1603
|
+
)
|
|
1604
|
+
translation = replacei(
|
|
1605
|
+
translation,
|
|
1606
|
+
r"\ba{1,2}khir[ _]*me *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1607
|
+
"like '%$match'"
|
|
1608
|
+
)
|
|
1609
|
+
translation = replacei(
|
|
1610
|
+
translation,
|
|
1611
|
+
r"\ba{1,2}khir[ _]*me[ _]*nahi *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1612
|
+
"not like '%$match'"
|
|
1613
|
+
)
|
|
1614
|
+
translation = replacei(
|
|
1615
|
+
translation,
|
|
1616
|
+
r"\bme(?:[_ ]*(?:he|moj(?:u|oo)d))? *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1617
|
+
"like '%$match%'"
|
|
1618
|
+
)
|
|
1619
|
+
translation = replacei(
|
|
1620
|
+
translation,
|
|
1621
|
+
r"\bme[_ ]*na(?:hi)?(?:[_ ]*(?:he|moj(?:u|oo)d))? *[\"\'](?<match>[^\"\']*)[\"\']",
|
|
1622
|
+
"not like '%$match%'"
|
|
1623
|
+
)
|
|
1624
|
+
# ^ HAVE to appear RIGHT here
|
|
1625
|
+
# not down there
|
|
1626
|
+
# right before string
|
|
1627
|
+
# replacements
|
|
1628
|
+
# these 6 are
|
|
1629
|
+
# the only replacements
|
|
1630
|
+
# that have to occur
|
|
1631
|
+
# BEFORE
|
|
1632
|
+
# strings are turned
|
|
1633
|
+
# into placeholders
|
|
1634
|
+
for i, string in enumerate(
|
|
1635
|
+
strings_and_column_names
|
|
1636
|
+
):
|
|
1637
|
+
translation = translation.replace(
|
|
1638
|
+
string,
|
|
1639
|
+
f"__STRING_{i}__",
|
|
1640
|
+
1
|
|
1641
|
+
)
|
|
1580
1642
|
translation = replace(
|
|
1581
1643
|
translation,
|
|
1582
1644
|
r"\s+",
|
|
@@ -1584,10 +1646,14 @@ def translate_for_sql(text: str) -> str:
|
|
|
1584
1646
|
)
|
|
1585
1647
|
# helps better deal with
|
|
1586
1648
|
# linebreaks, and tabs
|
|
1587
|
-
translation = replacei(translation, r"\bjis[_ ]?me moj(?:u|oo)d \(*([^\(\)]+)\)*", "($1)")
|
|
1588
1649
|
translation = replacei(
|
|
1589
1650
|
translation,
|
|
1590
|
-
r"(
|
|
1651
|
+
r"\bjis[_ ]?me moj(?:u|oo)d \(*([^\(\)]+)\)*",
|
|
1652
|
+
"($1)"
|
|
1653
|
+
)
|
|
1654
|
+
translation = replacei(
|
|
1655
|
+
translation,
|
|
1656
|
+
r"(?<table_name>(?<!\w)`*[A-Za-z_]\w*`*|`[A-Za-z_][\w ]*`) me da{1,2}lo\b",
|
|
1591
1657
|
"insert into $table_name"
|
|
1592
1658
|
)
|
|
1593
1659
|
# the right spot for this is ^
|
|
@@ -1599,21 +1665,67 @@ def translate_for_sql(text: str) -> str:
|
|
|
1599
1665
|
fr"\b({k})\b",
|
|
1600
1666
|
v
|
|
1601
1667
|
)
|
|
1602
|
-
translation = replacei(
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1668
|
+
translation = replacei(
|
|
1669
|
+
translation,
|
|
1670
|
+
r"(?<table_name>(?<!\w)`*[A-Za-z_]\w*`*|`[A-Za-z_][\w ]*`) me[_ ]?se\b",
|
|
1671
|
+
"from ${table_name}"
|
|
1672
|
+
)
|
|
1673
|
+
translation = replacei(
|
|
1674
|
+
translation,
|
|
1675
|
+
r"\b(?:a(?:uto)?|khud)[_ ]*(?:\+|barh(?:ti|e))(?!\w)",
|
|
1676
|
+
"autoincrement"
|
|
1677
|
+
)
|
|
1678
|
+
translation = replacei(
|
|
1679
|
+
translation,
|
|
1680
|
+
r" \b(not null)\?(?!\w)",
|
|
1681
|
+
""
|
|
1682
|
+
)
|
|
1683
|
+
# ^ a potential bug fix
|
|
1684
|
+
# do not remove
|
|
1685
|
+
# this replacement
|
|
1686
|
+
translation = replacei(
|
|
1687
|
+
translation,
|
|
1688
|
+
r"(?<=\)|(?<=\)|(?<=\)|(?<=\)) ) ) )\:(?= *\()",
|
|
1689
|
+
" values "
|
|
1690
|
+
)
|
|
1691
|
+
# do not touch
|
|
1692
|
+
# keep the replacements
|
|
1693
|
+
# as-is
|
|
1694
|
+
translation = replacei(
|
|
1695
|
+
translation,
|
|
1696
|
+
r" *\| *",
|
|
1697
|
+
" default "
|
|
1698
|
+
)
|
|
1699
|
+
translation = replacei(
|
|
1700
|
+
translation,
|
|
1701
|
+
r"\b(?<dropping_this_to_prvt_a_lgcl_err>default false) (?<instead_keeping>(?:not null )?default [A-Za-z_]\w*)\b",
|
|
1702
|
+
"$instead_keeping"
|
|
1703
|
+
)
|
|
1704
|
+
# ^ a potential bug fix 2
|
|
1705
|
+
# do not remove
|
|
1706
|
+
# this replacement
|
|
1607
1707
|
translation = replacei(translation, r"\b(?:begin|start|next)(?: transaction)?\:?(?!\w)", "begin transaction")
|
|
1608
1708
|
translation = replacei(translation, r"\b(end|upload|push|do)[\!\.]?(?!\w)", "commit")
|
|
1609
1709
|
translation = replacei(translation, r"\b(undo|revert|pop)[\!\.]?(?!\w)", "rollback")
|
|
1610
|
-
translation = replacei(translation, r" \b(se|
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1710
|
+
translation = replacei(translation, r" \b(?:se|k[aeio])\b", "")
|
|
1711
|
+
translation = replace(
|
|
1712
|
+
translation,
|
|
1713
|
+
r"\s+",
|
|
1714
|
+
" "
|
|
1715
|
+
)
|
|
1716
|
+
# optional
|
|
1717
|
+
# final
|
|
1718
|
+
# whitespace
|
|
1719
|
+
# re-cleanup
|
|
1720
|
+
# should happen BEFORE
|
|
1721
|
+
# bringing back the strings
|
|
1614
1722
|
translation += ";"
|
|
1615
1723
|
for j, string in enumerate(strings_and_column_names):
|
|
1616
|
-
translation = translation.replace(
|
|
1724
|
+
translation = translation.replace(
|
|
1725
|
+
f"__STRING_{j}__",
|
|
1726
|
+
string,
|
|
1727
|
+
1
|
|
1728
|
+
)
|
|
1617
1729
|
return translation
|
|
1618
1730
|
|
|
1619
1731
|
def main() -> None:
|