Python utilities to simplify connection with MongoDB through SSH tunnel
Project description
ssh-pymongo
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
Release history Release notifications | RSS feed
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.15.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file pymongo-ssh-0.0.15.tar.gz
.
File metadata
- Download URL: pymongo-ssh-0.0.15.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a8f553f6e998b53c6cbcbb6d315ec44fd252514503edd7acb6f3eebb2cc41c |
|
MD5 | b19b159f9d1292bf87c71556d04f7261 |
|
BLAKE2b-256 | b7e5e4fd6129959fb884fb6c058ada70c08086f921611ba48ead8e3e96c5876f |
File details
Details for the file pymongo_ssh-0.0.15-py3-none-any.whl
.
File metadata
- Download URL: pymongo_ssh-0.0.15-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af162787fa29fd7f0c703dcf41f9f102657b4e28f27ecd13fd29a24fba1623b3 |
|
MD5 | 4d4ee129df69c8519e809b17a56b4913 |
|
BLAKE2b-256 | 29239a16f4c54de34d028ac2d964ec1384dce62668f34a67d04e4029f71f588a |