cxnstr-1.1.4
توضیحات
Parse database connection strings
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cxnstr-1.1.4 |
| نام | cxnstr |
| نسخه کتابخانه | 1.1.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Joe Boyd |
| ایمیل نویسنده | josefuboyd@gmail.com |
| آدرس صفحه اصلی | https://github.com/jobo3208/cxnstr |
| آدرس اینترنتی | https://pypi.org/project/cxnstr/ |
| مجوز | - |
# 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}
نیازمندی
| مقدار | نام |
|---|---|
| ==1.11.0 | six |
نحوه نصب
نصب پکیج whl cxnstr-1.1.4:
pip install cxnstr-1.1.4.whl
نصب پکیج tar.gz cxnstr-1.1.4:
pip install cxnstr-1.1.4.tar.gz