read_dsn¶
In [ ]:
read_dsn(section: str,
dsn: str = "")
Reads the DSN information from the ODBCINI environment variable or the input file.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
section | str | ❌ | Name of the section in the configuration file. |
dsn | str | ✓ | Path to the file containing the credentials. If empty, the ODBCINI environment variable will be used. |
Returns¶
dict : dictionary with all the credentials
Example¶
In [3]:
from verticapy.connect import *
# Reading from DSN (ODBCINI)
dsn = read_dsn("VerticaDSN")
dsn
Out[3]:
In [24]:
# Reading from a file
dsn = read_dsn("vp_test_config",
"/Users/Badr/Library/Python/3.6/lib/python/site-packages/verticapy/tests/verticaPy_test.conf")
dsn
Out[24]: