Skip to main content

`Pytsql` allows to run mssql sripts, typically run via GUIs, via CLI.

Project description

pytsql

CI Documentation Status Conda-forge PypiVersion

pytsql allows to run mssql scripts, typically run from GUIs, from Python.

This, in turn, eases concurrent, scheduled and chained execution of scripts in a workflow. Put differently, it enables automated execution of Microsoft sql server scripts.

Moreover, pytsql supports parametrization of scripts, akin to templating.

Please have a look at our documentation if you're curious about more details.

Installation

To install, execute:

pip install pytsql

or in a conda environment

mamba install pytsql

Be aware that depending on your platform, you'will need specific drivers (Windows, Linux, macOS).

Usage

pytsql is tailored to run with MSSQL. Other sql dialects are not supported.

The main function of interest is execute. It requires a sqlalchemy Engine object as well as the path to the sql script of interest. A typical use case might look as follows:

import pytsql
from sqlalchemy import sa

db_connection_string = "connection_to_my_database"
engine = sa.get_engine(db_connection_string)

pytsql.execute("my_sql_script.sql", engine)

Please also have a look at our documentation sections on usage and development.

Credits

Grammar is based on antlr4/grammars-v4.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytsql-1.2.3.tar.gz (2.6 MB view hashes)

Uploaded Source

Built Distributions

pytsql-1.2.3-pp310-pypy310_pp73-win_amd64.whl (3.6 MB view hashes)

Uploaded PyPy Windows x86-64

pytsql-1.2.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pytsql-1.2.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (4.3 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytsql-1.2.3-pp39-pypy39_pp73-win_amd64.whl (3.6 MB view hashes)

Uploaded PyPy Windows x86-64

pytsql-1.2.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pytsql-1.2.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (4.3 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytsql-1.2.3-pp38-pypy38_pp73-win_amd64.whl (3.6 MB view hashes)

Uploaded PyPy Windows x86-64

pytsql-1.2.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (4.9 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

pytsql-1.2.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (4.3 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytsql-1.2.3-cp312-cp312-win_amd64.whl (3.6 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

pytsql-1.2.3-cp312-cp312-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.12 Windows x86

pytsql-1.2.3-cp312-cp312-musllinux_1_1_x86_64.whl (25.9 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pytsql-1.2.3-cp312-cp312-musllinux_1_1_i686.whl (24.9 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

pytsql-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (20.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

pytsql-1.2.3-cp312-cp312-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pytsql-1.2.3-cp311-cp311-win_amd64.whl (3.6 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

pytsql-1.2.3-cp311-cp311-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.11 Windows x86

pytsql-1.2.3-cp311-cp311-musllinux_1_1_x86_64.whl (25.9 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pytsql-1.2.3-cp311-cp311-musllinux_1_1_i686.whl (25.0 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

pytsql-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (20.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

pytsql-1.2.3-cp311-cp311-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pytsql-1.2.3-cp310-cp310-win_amd64.whl (3.6 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pytsql-1.2.3-cp310-cp310-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.10 Windows x86

pytsql-1.2.3-cp310-cp310-musllinux_1_1_x86_64.whl (25.9 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pytsql-1.2.3-cp310-cp310-musllinux_1_1_i686.whl (25.0 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

pytsql-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (20.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pytsql-1.2.3-cp310-cp310-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pytsql-1.2.3-cp39-cp39-win_amd64.whl (3.6 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pytsql-1.2.3-cp39-cp39-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.9 Windows x86

pytsql-1.2.3-cp39-cp39-musllinux_1_1_x86_64.whl (25.9 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pytsql-1.2.3-cp39-cp39-musllinux_1_1_i686.whl (24.9 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

pytsql-1.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (20.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pytsql-1.2.3-cp39-cp39-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pytsql-1.2.3-cp38-cp38-win_amd64.whl (3.6 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pytsql-1.2.3-cp38-cp38-win32.whl (3.5 MB view hashes)

Uploaded CPython 3.8 Windows x86

pytsql-1.2.3-cp38-cp38-musllinux_1_1_x86_64.whl (26.0 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pytsql-1.2.3-cp38-cp38-musllinux_1_1_i686.whl (25.0 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

pytsql-1.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pytsql-1.2.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (20.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pytsql-1.2.3-cp38-cp38-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page