Ready to get started?

Download a free trial of the Adobe Commerce ODBC Driver to get started:

 Download Now

Learn more:

Adobe Commerce Icon Adobe Commerce ODBC Driver

The Adobe Commerce ODBC Driver is a powerful tool that allows you to connect with live Adobe Commerce data, directly from any applications that support ODBC connectivity.

Access Adobe Commerce like you would a database - read, write, and update Customers, Inventory, Products, Orders, etc. through a standard ODBC Driver interface.

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.

  1. Click File -> Settings to open the project settings window.
  2. Click Project Interpreter from the Project: YourProjectName menu.
  3. To add pyodbc, click the + button and enter pyodbc.
  4. 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.