meerschaum 2.7.6__tar.gz → 2.7.7__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {meerschaum-2.7.6/meerschaum.egg-info → meerschaum-2.7.7}/PKG-INFO +14 -2
- meerschaum-2.7.7/meerschaum/actions/drop.py +164 -0
- meerschaum-2.7.7/meerschaum/actions/index.py +71 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/register.py +8 -12
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/sql.py +1 -1
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_pipes.py +18 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_plugins.py +1 -1
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_users.py +62 -61
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_version.py +1 -1
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_pipes.py +20 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_SQLConnector.py +6 -3
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_create_engine.py +1 -1
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_fetch.py +4 -9
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_instance.py +3 -3
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_pipes.py +255 -66
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_plugins.py +11 -16
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_sql.py +4 -8
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_uri.py +9 -9
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_users.py +10 -12
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/tables/__init__.py +13 -14
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/__init__.py +12 -2
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_attributes.py +32 -38
- meerschaum-2.7.7/meerschaum/core/Pipe/_drop.py +118 -0
- meerschaum-2.7.7/meerschaum/core/Pipe/_index.py +68 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/dtypes/sql.py +2 -2
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/sql.py +80 -34
- {meerschaum-2.7.6 → meerschaum-2.7.7/meerschaum.egg-info}/PKG-INFO +14 -2
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/SOURCES.txt +2 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_jobs.py +1 -1
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_sync.py +100 -0
- meerschaum-2.7.6/meerschaum/actions/drop.py +0 -86
- meerschaum-2.7.6/meerschaum/core/Pipe/_drop.py +0 -47
- {meerschaum-2.7.6 → meerschaum-2.7.7}/LICENSE +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/NOTICE +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/README.md +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/__main__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/arguments/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/arguments/_parse_arguments.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/arguments/_parser.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/docs/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/docs/index.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/entry.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/gui/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/gui/app/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/gui/app/_windows.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/gui/app/actions.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/gui/app/pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/Shell.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/ShellCompleter.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/ValidAutoSuggest.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/resources/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/shell/updates.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/term/TermPageHandler.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/term/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/_internal/term/tools.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/api.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/attach.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/bootstrap.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/clear.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/copy.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/deduplicate.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/delete.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/edit.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/install.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/login.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/os.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/pause.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/python.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/reload.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/restart.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/setup.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/sh.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/show.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/stack.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/start.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/stop.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/sync.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/tag.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/uninstall.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/upgrade.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/actions/verify.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/_chain.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/_events.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/_oauth2.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/_websockets.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/ansi_up.js +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/banner_1920x320.png +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/favicon.ico +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/logo_48x48.png +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/assets/logo_500x500.png +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/custom.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/dashboard.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/login.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/plugins.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/callbacks/register.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/components.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/connectors.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/graphs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/keys.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/dashboard.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/error.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/job.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/login.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/plugins.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pages/register.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/plugins.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/sessions.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/sync.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/users.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/websockets.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/dash/webterm.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/models/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/models/_interfaces.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/models/_locations.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/models/_metrics.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/models/_pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/bootstrap.min.css +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/dash.css +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/dbc_dark.css +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/styles.css +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/css/xterm.css +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/ico/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/ico/logo.ico +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/js/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/js/action_button.js +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/js/main.js +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/js/terminado.js +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/js/xterm.js +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/static/png/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/templates/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/templates/index.html +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/templates/old_index.html +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/templates/secret.html +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/resources/templates/termpage.html +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_actions.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_connectors.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_index.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_login.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_misc.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_version.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/routes/_webterm.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/api/tables/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_dash.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_default.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_edit.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_environment.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_formatting.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_patch.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_paths.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_preprocess.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_read_config.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_shell.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/_sync.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/paths.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/resources/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/stack/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/stack/grafana/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/stack/mosquitto/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/stack/mosquitto/resources/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/stack/resources/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/config/static/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/_Connector.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_APIConnector.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_actions.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_fetch.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_login.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_misc.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_plugins.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_request.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_uri.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/api/_users.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/parse.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/plugin/PluginConnector.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/plugin/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/poll.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/_cli.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/tables/types.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/sql/tools.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/_ValkeyConnector.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/_fetch.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/_pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/_plugins.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/connectors/valkey/_users.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_bootstrap.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_clear.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_copy.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_data.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_deduplicate.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_delete.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_dtypes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_edit.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_fetch.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_register.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_show.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_sync.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Pipe/_verify.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/Plugin/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/User/_User.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/User/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/core/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/jobs/_Executor.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/jobs/_Job.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/jobs/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/jobs/systemd.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/plugins/_Plugin.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/plugins/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/plugins/bootstrap.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/_get_pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/Daemon.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/FileDescriptorInterceptor.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/RotatingFile.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/StdinFile.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/daemon/_names.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/dataframe.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/debug.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/dtypes/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/formatting/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/formatting/_jobs.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/formatting/_pipes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/formatting/_pprint.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/formatting/_shell.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/interactive.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/misc.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/networking.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/packages/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/packages/_packages.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/packages/lazy_loader.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/pool.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/process.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/prompt.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/schedule.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/threading.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/typing.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/venv/_Venv.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/venv/__init__.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/warnings.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum/utils/yaml.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/dependency_links.txt +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/entry_points.txt +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/requires.txt +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/top_level.txt +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/meerschaum.egg-info/zip-safe +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/setup.cfg +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/setup.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_actions.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_arguments.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_deduplicate.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_pipe_data.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_pipes_dtypes.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_sql.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_users.py +0 -0
- {meerschaum-2.7.6 → meerschaum-2.7.7}/tests/test_verify.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: meerschaum
|
3
|
-
Version: 2.7.
|
3
|
+
Version: 2.7.7
|
4
4
|
Summary: Sync Time-Series Pipes with Meerschaum
|
5
5
|
Home-page: https://meerschaum.io
|
6
6
|
Author: Bennett Meares
|
@@ -318,6 +318,18 @@ Requires-Dist: python-multipart>=0.0.9; extra == "full"
|
|
318
318
|
Requires-Dist: httpx>=0.27.2; extra == "full"
|
319
319
|
Requires-Dist: httpcore>=1.0.6; extra == "full"
|
320
320
|
Requires-Dist: valkey>=6.0.0; extra == "full"
|
321
|
+
Dynamic: author
|
322
|
+
Dynamic: author-email
|
323
|
+
Dynamic: classifier
|
324
|
+
Dynamic: description
|
325
|
+
Dynamic: description-content-type
|
326
|
+
Dynamic: home-page
|
327
|
+
Dynamic: license
|
328
|
+
Dynamic: maintainer-email
|
329
|
+
Dynamic: project-url
|
330
|
+
Dynamic: provides-extra
|
331
|
+
Dynamic: requires-python
|
332
|
+
Dynamic: summary
|
321
333
|
|
322
334
|
<img src="https://meerschaum.io/assets/banner_1920x320.png" alt="Meerschaum banner" style="width: 100%"/>
|
323
335
|
|
@@ -0,0 +1,164 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# vim:fenc=utf-8
|
4
|
+
"""
|
5
|
+
Functions for dropping elements
|
6
|
+
"""
|
7
|
+
|
8
|
+
from __future__ import annotations
|
9
|
+
from meerschaum.utils.typing import SuccessTuple, Any, Optional, List
|
10
|
+
|
11
|
+
|
12
|
+
def drop(
|
13
|
+
action: Optional[List[str]] = None,
|
14
|
+
**kw: Any
|
15
|
+
) -> SuccessTuple:
|
16
|
+
"""
|
17
|
+
Drop pipe data (maintaining registration) or tables.
|
18
|
+
"""
|
19
|
+
from meerschaum.actions import choose_subaction
|
20
|
+
options = {
|
21
|
+
'pipes' : _drop_pipes,
|
22
|
+
'indices': _drop_indices,
|
23
|
+
'index': _drop_indices,
|
24
|
+
'indexes': _drop_indices,
|
25
|
+
}
|
26
|
+
return choose_subaction(action, options, **kw)
|
27
|
+
|
28
|
+
|
29
|
+
def _drop_pipes(
|
30
|
+
action: Optional[List[str]] = None,
|
31
|
+
yes: bool = False,
|
32
|
+
force: bool = False,
|
33
|
+
noask: bool = False,
|
34
|
+
debug: bool = False,
|
35
|
+
**kw: Any
|
36
|
+
) -> SuccessTuple:
|
37
|
+
"""
|
38
|
+
Drop pipes' tables but keep pipe metadata registration.
|
39
|
+
"""
|
40
|
+
from meerschaum.utils.prompt import yes_no
|
41
|
+
from meerschaum import get_pipes
|
42
|
+
from meerschaum.utils.warnings import warn
|
43
|
+
from meerschaum.utils.debug import dprint
|
44
|
+
from meerschaum.utils.formatting import pprint
|
45
|
+
|
46
|
+
pipes = get_pipes(as_list=True, debug=debug, **kw)
|
47
|
+
if len(pipes) == 0:
|
48
|
+
return False, "No pipes to drop."
|
49
|
+
|
50
|
+
question = (
|
51
|
+
"Are you sure you want to drop these tables?\n "
|
52
|
+
"Data will be lost and will need to be resynced.\n\n"
|
53
|
+
)
|
54
|
+
seen_targets = set()
|
55
|
+
for pipe in pipes:
|
56
|
+
target = pipe.target
|
57
|
+
if target in seen_targets:
|
58
|
+
continue
|
59
|
+
question += f" - {target}" + "\n"
|
60
|
+
seen_targets.add(target)
|
61
|
+
|
62
|
+
question += '\n'
|
63
|
+
if force:
|
64
|
+
answer = True
|
65
|
+
else:
|
66
|
+
answer = yes_no(question, default='n', noask=noask, yes=yes)
|
67
|
+
|
68
|
+
if not answer:
|
69
|
+
return False, "No pipes were dropped."
|
70
|
+
|
71
|
+
success_dict = {}
|
72
|
+
successes, fails = 0, 0
|
73
|
+
msg = ""
|
74
|
+
|
75
|
+
for pipe in pipes:
|
76
|
+
drop_success, drop_msg = pipe.drop(debug=debug)
|
77
|
+
success_dict[pipe] = drop_msg
|
78
|
+
if drop_success:
|
79
|
+
successes += 1
|
80
|
+
else:
|
81
|
+
fails += 1
|
82
|
+
warn(drop_msg, stack=False)
|
83
|
+
|
84
|
+
if debug:
|
85
|
+
dprint("Results for dropping pipes.")
|
86
|
+
pprint(success_dict)
|
87
|
+
|
88
|
+
msg = (
|
89
|
+
f"Finished dropping {len(pipes)} pipes"
|
90
|
+
+ ('s' if len(pipes) != 1 else '')
|
91
|
+
+ f"\n ({successes} succeeded, {fails} failed)."
|
92
|
+
)
|
93
|
+
return successes > 0, msg
|
94
|
+
|
95
|
+
|
96
|
+
def _drop_indices(
|
97
|
+
action: Optional[List[str]] = None,
|
98
|
+
yes: bool = False,
|
99
|
+
force: bool = False,
|
100
|
+
noask: bool = False,
|
101
|
+
debug: bool = False,
|
102
|
+
**kw: Any
|
103
|
+
) -> SuccessTuple:
|
104
|
+
"""
|
105
|
+
Drop pipes' tables but keep pipe metadata registration.
|
106
|
+
"""
|
107
|
+
from meerschaum.utils.prompt import yes_no
|
108
|
+
from meerschaum import get_pipes
|
109
|
+
from meerschaum.utils.warnings import warn
|
110
|
+
from meerschaum.utils.debug import dprint
|
111
|
+
from meerschaum.utils.formatting import pprint
|
112
|
+
|
113
|
+
pipes = get_pipes(as_list=True, debug=debug, **kw)
|
114
|
+
if len(pipes) == 0:
|
115
|
+
return False, "No pipes to drop."
|
116
|
+
|
117
|
+
question = "Are you sure you want to drop these indices?\n"
|
118
|
+
for pipe in pipes:
|
119
|
+
indices = pipe.get_indices()
|
120
|
+
if not indices:
|
121
|
+
continue
|
122
|
+
question += f"\n{pipe}\n"
|
123
|
+
for ix_key, index_name in indices.items():
|
124
|
+
question += f" - {index_name}\n"
|
125
|
+
|
126
|
+
question += '\n'
|
127
|
+
if force:
|
128
|
+
answer = True
|
129
|
+
else:
|
130
|
+
answer = yes_no(question, default='n', noask=noask, yes=yes)
|
131
|
+
|
132
|
+
if not answer:
|
133
|
+
return False, "No pipes were dropped."
|
134
|
+
|
135
|
+
success_dict = {}
|
136
|
+
successes, fails = 0, 0
|
137
|
+
msg = ""
|
138
|
+
|
139
|
+
for pipe in pipes:
|
140
|
+
drop_success, drop_msg = pipe.drop_indices(debug=debug)
|
141
|
+
success_dict[pipe] = drop_msg
|
142
|
+
if drop_success:
|
143
|
+
successes += 1
|
144
|
+
else:
|
145
|
+
fails += 1
|
146
|
+
warn(drop_msg, stack=False)
|
147
|
+
|
148
|
+
if debug:
|
149
|
+
dprint("Results for dropping indices.")
|
150
|
+
pprint(success_dict)
|
151
|
+
|
152
|
+
msg = (
|
153
|
+
f"Finished dropping indices for {len(pipes)} pipe"
|
154
|
+
+ ('s' if len(pipes) != 1 else '')
|
155
|
+
+ f"\n ({successes} succeeded, {fails} failed)."
|
156
|
+
)
|
157
|
+
return successes > 0, msg
|
158
|
+
|
159
|
+
|
160
|
+
### NOTE: This must be the final statement of the module.
|
161
|
+
### Any subactions added below these lines will not
|
162
|
+
### be added to the `help` docstring.
|
163
|
+
from meerschaum.actions import choices_docstring as _choices_docstring
|
164
|
+
drop.__doc__ += _choices_docstring('drop')
|
@@ -0,0 +1,71 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# vim:fenc=utf-8
|
4
|
+
|
5
|
+
"""
|
6
|
+
Functions for indexing tables.
|
7
|
+
"""
|
8
|
+
|
9
|
+
from __future__ import annotations
|
10
|
+
from meerschaum.utils.typing import SuccessTuple, Any, Optional, List
|
11
|
+
|
12
|
+
|
13
|
+
def index(
|
14
|
+
action: Optional[List[str]] = None,
|
15
|
+
**kw: Any
|
16
|
+
) -> SuccessTuple:
|
17
|
+
"""
|
18
|
+
Create pipes' indices.
|
19
|
+
"""
|
20
|
+
from meerschaum.actions import choose_subaction
|
21
|
+
options = {
|
22
|
+
'pipes' : _index_pipes,
|
23
|
+
}
|
24
|
+
return choose_subaction(action, options, **kw)
|
25
|
+
|
26
|
+
|
27
|
+
def _index_pipes(
|
28
|
+
action: Optional[List[str]] = None,
|
29
|
+
yes: bool = False,
|
30
|
+
force: bool = False,
|
31
|
+
noask: bool = False,
|
32
|
+
debug: bool = False,
|
33
|
+
**kw: Any
|
34
|
+
) -> SuccessTuple:
|
35
|
+
"""
|
36
|
+
Create pipes' indices.
|
37
|
+
"""
|
38
|
+
from meerschaum import get_pipes
|
39
|
+
from meerschaum.utils.warnings import warn, info
|
40
|
+
|
41
|
+
pipes = get_pipes(as_list=True, debug=debug, **kw)
|
42
|
+
if len(pipes) == 0:
|
43
|
+
return False, "No pipes to index."
|
44
|
+
|
45
|
+
success_dict = {}
|
46
|
+
successes, fails = 0, 0
|
47
|
+
msg = ""
|
48
|
+
|
49
|
+
for pipe in pipes:
|
50
|
+
info(f"Creating indices for {pipe}...")
|
51
|
+
index_success, index_msg = pipe.create_indices(debug=debug)
|
52
|
+
success_dict[pipe] = index_msg
|
53
|
+
if index_success:
|
54
|
+
successes += 1
|
55
|
+
else:
|
56
|
+
fails += 1
|
57
|
+
warn(index_msg, stack=False)
|
58
|
+
|
59
|
+
msg = (
|
60
|
+
f"Finished indexing {len(pipes)} pipes"
|
61
|
+
+ ('s' if len(pipes) != 1 else '')
|
62
|
+
+ f"\n ({successes} succeeded, {fails} failed)."
|
63
|
+
)
|
64
|
+
return successes > 0, msg
|
65
|
+
|
66
|
+
|
67
|
+
### NOTE: This must be the final statement of the module.
|
68
|
+
### Any subactions added below these lines will not
|
69
|
+
### be added to the `help` docstring.
|
70
|
+
from meerschaum.actions import choices_docstring as _choices_docstring
|
71
|
+
index.__doc__ += _choices_docstring('index')
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
10
10
|
import meerschaum as mrsm
|
11
11
|
from meerschaum.utils.typing import SuccessTuple, Any, List, Optional, Dict
|
12
12
|
|
13
|
+
|
13
14
|
def register(
|
14
15
|
action: Optional[List[str]] = None,
|
15
16
|
**kw: Any
|
@@ -70,10 +71,9 @@ def _register_pipes(
|
|
70
71
|
`connector_keys` and `metric_keys`.
|
71
72
|
If `location_keys` is empty, assume [`None`].
|
72
73
|
"""
|
73
|
-
from meerschaum import get_pipes
|
74
|
+
from meerschaum import get_pipes
|
74
75
|
from meerschaum.utils.debug import dprint
|
75
|
-
from meerschaum.utils.warnings import warn
|
76
|
-
from meerschaum.utils.misc import items_str
|
76
|
+
from meerschaum.utils.warnings import warn
|
77
77
|
from meerschaum.config._patch import apply_patch_to_config
|
78
78
|
|
79
79
|
if connector_keys is None:
|
@@ -164,10 +164,8 @@ def _register_plugins(
|
|
164
164
|
from meerschaum.utils.debug import dprint
|
165
165
|
from meerschaum.plugins import reload_plugins, get_plugins_names
|
166
166
|
from meerschaum.connectors.parse import parse_repo_keys
|
167
|
-
from meerschaum.
|
168
|
-
from meerschaum.utils.warnings import warn, error, info
|
167
|
+
from meerschaum.utils.warnings import warn, info
|
169
168
|
from meerschaum.core import Plugin
|
170
|
-
from meerschaum import get_connector
|
171
169
|
from meerschaum.utils.formatting import print_tuple
|
172
170
|
from meerschaum.utils.prompt import prompt, yes_no
|
173
171
|
|
@@ -179,7 +177,7 @@ def _register_plugins(
|
|
179
177
|
repo_connector = parse_repo_keys(repository)
|
180
178
|
if repo_connector.__dict__.get('type', None) != 'api':
|
181
179
|
return False, (
|
182
|
-
|
180
|
+
"Can only upload plugins to the Meerschaum API." +
|
183
181
|
f"Connector '{repo_connector}' is of type " +
|
184
182
|
f"'{repo_connector.get('type', type(repo_connector))}'."
|
185
183
|
)
|
@@ -283,13 +281,11 @@ def _register_users(
|
|
283
281
|
"""
|
284
282
|
from meerschaum.config import get_config
|
285
283
|
from meerschaum.config.static import STATIC_CONFIG
|
286
|
-
from meerschaum import get_connector
|
287
284
|
from meerschaum.connectors.parse import parse_instance_keys
|
288
|
-
from meerschaum.utils.
|
289
|
-
from meerschaum.utils.warnings import warn, error, info
|
285
|
+
from meerschaum.utils.warnings import warn, info
|
290
286
|
from meerschaum.core import User
|
291
287
|
from meerschaum.utils.formatting import print_tuple
|
292
|
-
from meerschaum.utils.prompt import
|
288
|
+
from meerschaum.utils.prompt import get_password, get_email
|
293
289
|
if mrsm_instance is None:
|
294
290
|
mrsm_instance = get_config('meerschaum', 'instance')
|
295
291
|
instance_connector = parse_instance_keys(mrsm_instance)
|
@@ -325,7 +321,7 @@ def _register_users(
|
|
325
321
|
minimum_length = STATIC_CONFIG['users']['min_password_length']
|
326
322
|
)
|
327
323
|
email = get_email(username, allow_omit=True)
|
328
|
-
except Exception
|
324
|
+
except Exception:
|
329
325
|
return False, (
|
330
326
|
"Aborted registering users " +
|
331
327
|
', '.join(
|
@@ -127,7 +127,7 @@ def sql(
|
|
127
127
|
|
128
128
|
from meerschaum.utils.packages import attempt_import
|
129
129
|
from meerschaum.utils.formatting import print_tuple, pprint
|
130
|
-
_ = attempt_import('sqlalchemy.engine.result')
|
130
|
+
_ = attempt_import('sqlalchemy.engine.result', lazy=False)
|
131
131
|
if 'sqlalchemy' in str(type(result)):
|
132
132
|
if not nopretty:
|
133
133
|
print_tuple((True, f"Successfully executed query:\n\n{query}"))
|
@@ -688,3 +688,21 @@ def get_pipe_columns_indices(
|
|
688
688
|
Return a dictionary of column names and related indices.
|
689
689
|
"""
|
690
690
|
return get_pipe(connector_keys, metric_key, location_key).get_columns_indices()
|
691
|
+
|
692
|
+
|
693
|
+
@app.get(
|
694
|
+
pipes_endpoint + '/{connector_keys}/{metric_key}/{location_key}/indices/names',
|
695
|
+
tags=['Pipes']
|
696
|
+
)
|
697
|
+
def get_pipe_index_names(
|
698
|
+
connector_keys: str,
|
699
|
+
metric_key: str,
|
700
|
+
location_key: str,
|
701
|
+
curr_user=(
|
702
|
+
fastapi.Depends(manager) if not no_auth else None
|
703
|
+
),
|
704
|
+
) -> Dict[str, List[Dict[str, str]]]:
|
705
|
+
"""
|
706
|
+
Return a dictionary of index keys and index names.
|
707
|
+
"""
|
708
|
+
return get_pipe(connector_keys, metric_key, location_key).get_indices()
|
@@ -29,7 +29,7 @@ from meerschaum.core import Plugin
|
|
29
29
|
starlette_responses = attempt_import('starlette.responses', warn=False)
|
30
30
|
FileResponse = starlette_responses.FileResponse
|
31
31
|
|
32
|
-
sqlalchemy = attempt_import('sqlalchemy')
|
32
|
+
sqlalchemy = attempt_import('sqlalchemy', lazy=False)
|
33
33
|
plugins_endpoint = endpoints['plugins']
|
34
34
|
|
35
35
|
@app.post(plugins_endpoint + '/{name}', tags=['Plugins'])
|
@@ -7,36 +7,34 @@ Routes for managing users
|
|
7
7
|
"""
|
8
8
|
|
9
9
|
from __future__ import annotations
|
10
|
+
|
10
11
|
from meerschaum.utils.typing import (
|
11
|
-
|
12
|
+
Union, SuccessTuple, Any, Dict, List
|
12
13
|
)
|
13
14
|
|
14
15
|
from meerschaum.utils.packages import attempt_import
|
15
16
|
from meerschaum.api import (
|
16
|
-
fastapi, app, endpoints, get_api_connector,
|
17
|
-
|
17
|
+
fastapi, app, endpoints, get_api_connector, manager,
|
18
|
+
debug, check_allow_chaining, DISALLOW_CHAINING_MESSAGE,
|
18
19
|
no_auth, private,
|
19
20
|
)
|
20
21
|
from meerschaum.utils.misc import string_to_dict
|
21
22
|
from meerschaum.config import get_config
|
22
|
-
from meerschaum.api.tables import get_tables
|
23
|
-
from starlette.responses import Response, JSONResponse
|
24
23
|
from meerschaum.core import User
|
25
|
-
import os, pathlib, datetime
|
26
24
|
|
27
|
-
|
28
|
-
sqlalchemy = attempt_import('sqlalchemy')
|
25
|
+
sqlalchemy = attempt_import('sqlalchemy', lazy=False)
|
29
26
|
users_endpoint = endpoints['users']
|
30
27
|
|
31
28
|
import fastapi
|
32
29
|
from fastapi import HTTPException, Form
|
33
30
|
|
31
|
+
|
34
32
|
@app.get(users_endpoint + "/me", tags=['Users'])
|
35
33
|
def read_current_user(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
curr_user = (
|
35
|
+
fastapi.Depends(manager) if not no_auth else None
|
36
|
+
),
|
37
|
+
) -> Dict[str, Union[str, int]]:
|
40
38
|
"""
|
41
39
|
Get information about the currently logged-in user.
|
42
40
|
"""
|
@@ -58,12 +56,13 @@ def read_current_user(
|
|
58
56
|
),
|
59
57
|
}
|
60
58
|
|
59
|
+
|
61
60
|
@app.get(users_endpoint, tags=['Users'])
|
62
61
|
def get_users(
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
curr_user = (
|
63
|
+
fastapi.Depends(manager) if private else None
|
64
|
+
),
|
65
|
+
) -> List[str]:
|
67
66
|
"""
|
68
67
|
Get a list of the registered users.
|
69
68
|
"""
|
@@ -72,15 +71,15 @@ def get_users(
|
|
72
71
|
|
73
72
|
@app.post(users_endpoint + "/register", tags=['Users'])
|
74
73
|
def register_user(
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
74
|
+
username: str = Form(None),
|
75
|
+
password: str = Form(None),
|
76
|
+
attributes: str = Form(None),
|
77
|
+
type: str = Form(None),
|
78
|
+
email: str = Form(None),
|
79
|
+
curr_user = (
|
80
|
+
fastapi.Depends(manager) if private else None
|
81
|
+
),
|
82
|
+
) -> SuccessTuple:
|
84
83
|
"""
|
85
84
|
Register a new user.
|
86
85
|
"""
|
@@ -90,7 +89,7 @@ def register_user(
|
|
90
89
|
if attributes is not None:
|
91
90
|
try:
|
92
91
|
attributes = string_to_dict(attributes)
|
93
|
-
except Exception
|
92
|
+
except Exception:
|
94
93
|
return False, f"Invalid dictionary string received for attributes."
|
95
94
|
|
96
95
|
allow_users = get_config('system', 'api', 'permissions', 'registration', 'users')
|
@@ -114,22 +113,22 @@ def register_user(
|
|
114
113
|
|
115
114
|
@app.post(users_endpoint + "/edit", tags=['Users'])
|
116
115
|
def edit_user(
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
116
|
+
username: str = Form(None),
|
117
|
+
password: str = Form(None),
|
118
|
+
type: str = Form(None),
|
119
|
+
email: str = Form(None),
|
120
|
+
attributes: str = Form(None),
|
121
|
+
curr_user = (
|
122
|
+
fastapi.Depends(manager) if not no_auth else None
|
123
|
+
),
|
124
|
+
) -> SuccessTuple:
|
126
125
|
"""
|
127
126
|
Edit an existing user.
|
128
127
|
"""
|
129
128
|
if attributes is not None:
|
130
129
|
try:
|
131
130
|
attributes = string_to_dict(attributes)
|
132
|
-
except Exception
|
131
|
+
except Exception:
|
133
132
|
return False, f"Invalid dictionary string received for attributes."
|
134
133
|
|
135
134
|
user = User(username, password, email=email, attributes=attributes)
|
@@ -144,11 +143,11 @@ def edit_user(
|
|
144
143
|
|
145
144
|
@app.get(users_endpoint + "/{username}/id", tags=['Users'])
|
146
145
|
def get_user_id(
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
146
|
+
username : str,
|
147
|
+
curr_user = (
|
148
|
+
fastapi.Depends(manager) if not no_auth else None
|
149
|
+
),
|
150
|
+
) -> Union[int, None]:
|
152
151
|
"""
|
153
152
|
Get a user's ID.
|
154
153
|
"""
|
@@ -157,23 +156,24 @@ def get_user_id(
|
|
157
156
|
|
158
157
|
@app.get(users_endpoint + "/{username}/attributes", tags=['Users'])
|
159
158
|
def get_user_attributes(
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
159
|
+
username : str,
|
160
|
+
curr_user = (
|
161
|
+
fastapi.Depends(manager) if private else None
|
162
|
+
),
|
163
|
+
) -> Union[Dict[str, Any], None]:
|
165
164
|
"""
|
166
165
|
Get a user's attributes.
|
167
166
|
"""
|
168
167
|
return get_api_connector().get_user_attributes(User(username), debug=debug)
|
169
168
|
|
169
|
+
|
170
170
|
@app.delete(users_endpoint + "/{username}", tags=['Users'])
|
171
171
|
def delete_user(
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
172
|
+
username: str,
|
173
|
+
curr_user = (
|
174
|
+
fastapi.Depends(manager) if not no_auth else None
|
175
|
+
),
|
176
|
+
) -> SuccessTuple:
|
177
177
|
"""
|
178
178
|
Delete a user.
|
179
179
|
"""
|
@@ -193,11 +193,11 @@ def delete_user(
|
|
193
193
|
|
194
194
|
@app.get(users_endpoint + '/{username}/password_hash', tags=['Users'])
|
195
195
|
def get_user_password_hash(
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
196
|
+
username: str,
|
197
|
+
curr_user = (
|
198
|
+
fastapi.Depends(manager) if not no_auth else None
|
199
|
+
),
|
200
|
+
) -> str:
|
201
201
|
"""
|
202
202
|
If configured to allow chaining, return a user's password_hash.
|
203
203
|
"""
|
@@ -205,13 +205,14 @@ def get_user_password_hash(
|
|
205
205
|
raise HTTPException(status_code=403, detail=DISALLOW_CHAINING_MESSAGE)
|
206
206
|
return get_api_connector().get_user_password_hash(User(username), debug=debug)
|
207
207
|
|
208
|
+
|
208
209
|
@app.get(users_endpoint + '/{username}/type', tags=['Users'])
|
209
210
|
def get_user_type(
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
211
|
+
username : str,
|
212
|
+
curr_user = (
|
213
|
+
fastapi.Depends(manager) if not no_auth else None
|
214
|
+
),
|
215
|
+
) -> str:
|
215
216
|
"""
|
216
217
|
If configured to allow chaining, return a user's type.
|
217
218
|
"""
|
@@ -757,3 +757,23 @@ def get_pipe_columns_indices(
|
|
757
757
|
warn(response.text)
|
758
758
|
return None
|
759
759
|
return j
|
760
|
+
|
761
|
+
|
762
|
+
def get_pipe_index_names(self, pipe: mrsm.Pipe, debug: bool = False) -> Dict[str, str]:
|
763
|
+
"""
|
764
|
+
Return the templated index names.
|
765
|
+
"""
|
766
|
+
r_url = pipe_r_url(pipe) + '/indices/names'
|
767
|
+
response = self.get(
|
768
|
+
r_url,
|
769
|
+
debug=debug
|
770
|
+
)
|
771
|
+
j = response.json()
|
772
|
+
if isinstance(j, dict) and 'detail' in j and len(j.keys()) == 1:
|
773
|
+
warn(j['detail'])
|
774
|
+
return None
|
775
|
+
if not isinstance(j, dict):
|
776
|
+
warn(response.text)
|
777
|
+
return None
|
778
|
+
return j
|
779
|
+
|
@@ -70,6 +70,9 @@ class SQLConnector(Connector):
|
|
70
70
|
create_pipe_table_from_df,
|
71
71
|
get_pipe_columns_indices,
|
72
72
|
get_temporary_target,
|
73
|
+
create_pipe_indices,
|
74
|
+
drop_pipe_indices,
|
75
|
+
get_pipe_index_names,
|
73
76
|
)
|
74
77
|
from ._plugins import (
|
75
78
|
register_plugin,
|
@@ -222,7 +225,7 @@ class SQLConnector(Connector):
|
|
222
225
|
return None
|
223
226
|
|
224
227
|
from meerschaum.utils.packages import attempt_import
|
225
|
-
sqlalchemy_orm = attempt_import('sqlalchemy.orm')
|
228
|
+
sqlalchemy_orm = attempt_import('sqlalchemy.orm', lazy=False)
|
226
229
|
session_factory = sqlalchemy_orm.sessionmaker(self.engine)
|
227
230
|
self._Session = sqlalchemy_orm.scoped_session(session_factory)
|
228
231
|
|
@@ -290,7 +293,7 @@ class SQLConnector(Connector):
|
|
290
293
|
Return the metadata bound to this configured schema.
|
291
294
|
"""
|
292
295
|
from meerschaum.utils.packages import attempt_import
|
293
|
-
sqlalchemy = attempt_import('sqlalchemy')
|
296
|
+
sqlalchemy = attempt_import('sqlalchemy', lazy=False)
|
294
297
|
if '_metadata' not in self.__dict__:
|
295
298
|
self._metadata = sqlalchemy.MetaData(schema=self.schema)
|
296
299
|
return self._metadata
|
@@ -368,7 +371,7 @@ class SQLConnector(Connector):
|
|
368
371
|
self.__dict__['schema'] = None
|
369
372
|
return None
|
370
373
|
|
371
|
-
sqlalchemy = mrsm.attempt_import('sqlalchemy')
|
374
|
+
sqlalchemy = mrsm.attempt_import('sqlalchemy', lazy=False)
|
372
375
|
_schema = sqlalchemy.inspect(self.engine).default_schema_name
|
373
376
|
self.__dict__['schema'] = _schema
|
374
377
|
return _schema
|
@@ -186,7 +186,7 @@ def create_engine(
|
|
186
186
|
"""Create a sqlalchemy engine by building the engine string."""
|
187
187
|
from meerschaum.utils.packages import attempt_import
|
188
188
|
from meerschaum.utils.warnings import error, warn
|
189
|
-
sqlalchemy = attempt_import('sqlalchemy')
|
189
|
+
sqlalchemy = attempt_import('sqlalchemy', lazy=False)
|
190
190
|
import urllib
|
191
191
|
import copy
|
192
192
|
### Install and patch required drivers.
|