Skip to main content

Python library to connect to SQLAlchemy with SSH Tunnel

Project description

sqlalchemy-connector

py-sqlalchemy-ssh-connector

PyPI Latest Release PyPI Build PyPI - Downloads) PyPI - Python Version)

Python library to connect to SQLAlchemy with SSH Tunnel.

Where to get it

The source code is currently hosted on GitHub at: https://github.com/pualien/py-sqlalchemy-ssh-connector

Binary installers for the latest released version are available at the Python package index

pip install sqlalchemy-connector

Example 1

from alchemy_connector import SQLAlchemySession

session = SQLAlchemySession('db.example.com')
result = session.execute('''select * from ecommerce_transactions limit 1''')
session.stop()
# session.start()

Example 2

{adapter}://{username}:{password}@{host}:{port}/{database}

session = SQLAlchemySession(
    host='db.example.com',
    uri='mysql+pymysql://user:password@127.0.0.1:3306/db'
)
...
session.stop()

Example 3

session = SQLAlchemySession(
    host='db.example.com',
    user='myuser',
    password='mypassword',
)
...
session.stop()

Example 4

session = SQLAlchemySession(
    host='db.example.com',
    port='21',
    user='myuser',
    key='/home/myplace/.ssh/id_rsa2',
    to_port='37017',
    to_host='0.0.0.0'
)
...
session.stop()

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

sqlalchemy-connector-0.1.38b1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

sqlalchemy_connector-0.1.38b1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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