Skip to main content

return output from unixODBC `odbcinst` command

Project description


return output from unixODBC odbcinst command


pip install odbcinst


The .j() function executes odbcinst -j. If called with no argument it returns a dict. If called with a str argument it returns the specified value.

from pprint import pprint

import odbcinst

"""console output:
{'DRIVERS': '/etc/odbcinst.ini',
 'FILE DATA SOURCES': '/etc/ODBCDataSources',
 'SQLLEN Size': '8',
 'SQLULEN Size': '8',
 'SYSTEM DATA SOURCES': '/etc/odbc.ini',
 'USER DATA SOURCES': '/home/gord/.odbc.ini',
 'unixODBC': '2.3.4'}

# '2.3.4'

If unixODBC is not installed then the results are

"""console output:
{'unixODBC': None}

print(repr(odbcinst.j("SYSTEM DATA SOURCES")))
# None

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odbcinst-1.0.1.tar.gz (2.0 kB view hashes)

Uploaded source

Built Distribution

odbcinst-1.0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page