Establishing a Connection
The objects available within our connector are accessible from the "cdata.api" module. To use the module's objects directly:
- Import the module as follows:
import cdata.api as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("Profile=<Path to Profile>;ProfileSettings=<Profile Configuration Settings>")
The CData Python Connector for API can be used to connect to a variety of data sources from within your application.
Connecting to Profiles
The connector can be used to connect to a variety of data sources, called Profiles, from within your application. An API profile is a collection of schemas modeling data from an application or online service as tables, views or stored procedures. API Profile files have the file exension ".apip" and can be download from the CData website.
To establish a connection using a Profile, set the Profile property to the path of the API profile file, and ProfileSettings to a connection string containing the credentials to the data-source. The most common forms of authentication are supported, including HTTP basic, HTTP digest, NTLM, and OAuth. For more information on the required connection properties, please refer to the documentation of each profile.