Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →Using the CData ODBC Driver for Adobe Commerce in PyCharm
Connect to Adobe Commerce as an ODBC data source in PyCharm using the CData ODBC Driver for Adobe Commerce.
The CData ODBC Drivers can be used in any environment that supports loading an ODBC Driver. In this tutorial we will explore using the CData ODBC Driver for Adobe Commerce from within PyCharm. Included are steps for adding the CData ODBC Driver as a data source, as well as basic PyCharm code to query the data source and display results.
To begin, this tutorial will assume that you have already installed the CData ODBC Driver for Adobe Commerce as well as PyCharm.
Add Pyodbc to the Project
Follow the steps below to add the pyodbc module to your project.
- Click File -> Settings to open the project settings window.
- Click Project Interpreter from the Project: YourProjectName menu.
- To add pyodbc, click the + button and enter pyodbc.
- Click Install Package to install pyodbc.

Connect to Adobe Commerce
You can now connect with an ODBC connection string or a DSN. See the Getting Started section in the CData driver documentation for a guide to creating a DSN on your OS.
Adobe Commerce uses the OAuth 1 authentication standard. To connect to the Adobe Commerce REST API, you will need to obtain values for the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties by registering an app with your Adobe Commerce system. See the "Getting Started" section in the help documentation for a guide to obtaining the OAuth values and connecting.
You will also need to provide the URL to your Adobe Commerce system. The URL depends on whether you are using the Adobe Commerce REST API as a customer or administrator.
Customer: To use Adobe Commerce as a customer, make sure you have created a customer account in the Adobe Commerce homepage. To do so, click Account -> Register. You can then set the URL connection property to the endpoint of your Adobe Commerce system.
Administrator: To access Adobe Commerce as an administrator, set CustomAdminPath instead. This value can be obtained in the Advanced settings in the Admin menu, which can be accessed by selecting System -> Configuration -> Advanced -> Admin -> Admin Base URL.
If the Use Custom Admin Path setting on this page is set to YES, the value is inside the Custom Admin Path text box; otherwise, set the CustomAdminPath connection property to the default value, which is "admin".
Below is the syntax for a DSN:
[CData Adobe Commerce Source]
Driver = CData ODBC Driver for Adobe Commerce
Description = My Description
OAuthClientId = MyConsumerKey
OAuthClientSecret = MyConsumerSecret
CallbackURL = http://127.0.0.1:33333
Url = https://myAdobe Commercehost.com
Execute SQL to Adobe Commerce
Instantiate a Cursor and use the execute method of the Cursor class to execute any SQL statement.
import pyodbc
cnxn = pyodbc.connect('DRIVER={CData ODBC Driver for Adobe Commerce};OAuthClientId = MyConsumerKey;OAuthClientSecret = MyConsumerSecret;CallbackURL = http://127.0.0.1:33333;Url = https://myAdobe Commercehost.com;')
cursor = cnxn.cursor()
cursor.execute("SELECT Name, Price FROM Products WHERE Style = 'High Tech'")
rows = cursor.fetchall()
for row in rows:
print(row.Name, row.Price)
After connecting to Adobe Commerce in PyCharm using the CData ODBC Driver, you will be able to build Python apps with access to Adobe Commerce data as if it were a standard database. If you have any questions, comments, or feedback regarding this tutorial, please contact us at support@cdata.com.