Parse database connection strings
Project description
cxnstr
Parse database connection strings in python. Currently only supports MySQL.
>>> import cxnstr
>>> params = cxnstr.to_dict("myhost:3306/MyDB?read_default_file=~/.my.cnf")
>>> params
{'host': 'myhost', 'port': 3306, 'db': 'MyDB', 'read_default_file': '~/.my.cnf'}
>>> import pymysql
>>> conn = pymysql.connect(**params)
See doctests for full connection string specification.
The library also includes a command line program for parsing connection strings and outputting in various formats:
$ cxnstr -t json "myhost:3306/MyDB?read_default_file=~/.my.cnf"
{"read_default_file": "~/.my.cnf", "db": "MyDB", "host": "myhost", "port": 3306}
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
cxnstr-1.1.5.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cxnstr-1.1.5.tar.gz.
File metadata
- Download URL: cxnstr-1.1.5.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39dd4bd2e18254662ff331751999430c8e490d2df2bc4f83319eae14af5a507f
|
|
| MD5 |
bc89e20cb0f69cb8f5459cc1d8cbb842
|
|
| BLAKE2b-256 |
c91f1d975507db8d4f832f096b4589f5ff1b6ac82b4c7880e3bf952f415976fb
|
File details
Details for the file cxnstr-1.1.5-py2-none-any.whl.
File metadata
- Download URL: cxnstr-1.1.5-py2-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb39118982e93a17c891d4bd7ed858bd065c8ecd145cddb2075ef496ccddba14
|
|
| MD5 |
8957a81bc880af439c4085b8e783a3fa
|
|
| BLAKE2b-256 |
8819ba58b0fa9341521f1e0dc8b83eeeaf6e02a549d20a680853c9ec8917d03a
|