Skip to main content

Python utilities to simplify connection with MongoDB through SSH tunnel

Project description

ssh-pymongo

ssh-pymongo

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

Python utilities to simplify connection with MongoDB through SSH tunnel. Note: uri parameter is assumed as local, after ssh.

Where to get it

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

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

pip install pymongo-ssh

Example 1

from pymongo_ssh import MongoSession

session = MongoSession('db.example.com')
db = session.connection['db-name']
session.stop()
# session.start()

Example 2

session = MongoSession(
    host='db.example.com',
    uri='mongodb://user:password@127.0.0.1/?authSource=admin&authMechanism=SCRAM-SHA-256'
)
...
session.stop()

Example 3

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

Example 4

session = MongoSession(
    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

pymongo-ssh-0.0.7.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymongo_ssh-0.0.7-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pymongo-ssh-0.0.7.tar.gz.

File metadata

  • Download URL: pymongo-ssh-0.0.7.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for pymongo-ssh-0.0.7.tar.gz
Algorithm Hash digest
SHA256 bdc12dfe50a8c40406a3aa25807028c72f2da20b3767acb579b7af6ba165978b
MD5 3fc3ca012aa63adcd8cae01b7e284135
BLAKE2b-256 fcb57e979be1df025423f763e98f2b29d24b13731d42e336a9dfe898e8a7aeb6

See more details on using hashes here.

File details

Details for the file pymongo_ssh-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pymongo_ssh-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for pymongo_ssh-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b43843d684b63ab886265e38b2de51e9b883c388098172418779c7f1087a9952
MD5 af4f9249531bc24bec62fad143a0c749
BLAKE2b-256 4183b93954d5f95b5657f49187fc1f06e5254fcfedf77a5a9fe9a144e40ef34a

See more details on using hashes here.

Supported by

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