New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

pymongo-ssh

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pymongo-ssh

Python utilities to simplify connection with MongoDB through SSH tunnel

0.0.15
Maintainers
1

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()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts