![]() |
VOOZH | about |
The rich ecosystem of Python modules lets you get to work quickly and integrate your systems more effectively. With the CData Python Connector for Epicor Kinetic and the petl framework, you can build Epicor Kinetic-connected applications and pipelines for extracting, transforming, and loading Epicor Kinetic data. This article shows how to connect to Epicor Kinetic with the CData Python Connector and use petl and pandas to extract, transform, and load Epicor Kinetic data.
With built-in, optimized data processing, the CData Python Connector offers unmatched performance for interacting with live Epicor Kinetic data in Python. When you issue complex SQL queries from Epicor Kinetic, the driver pushes supported SQL operations, like filters and aggregations, directly to Epicor Kinetic and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations).
Connecting to Epicor Kinetic data looks just like connecting to any relational data source. Create a connection string using the required connection properties. For this article, you will pass the connection string as a parameter to the create_engine function.
To successfully connect to your ERP instance, you must specify the following connection properties:
In addition, you may also set the optional connection properties:
After installing the CData Epicor Kinetic Connector, follow the procedure below to install the other required modules and start accessing Epicor Kinetic through Python objects.
Use the pip utility to install the required modules and frameworks:
pip install petl pip install pandas
Once the required modules and frameworks are installed, we are ready to build our ETL app. Code snippets follow, but the full source code is available at the end of the article.
First, be sure to import the modules (including the CData Connector) with the following:
import petl as etl import pandas as pd import cdata.epicorerp as mod
You can now connect with a connection string. Use the connect function for the CData Epicor Kinetic Connector to create a connection for working with Epicor Kinetic data.
cnxn = mod.connect("Service=Erp.BO.CustomerSvc;ERPInstance=MyInstance;URL=https://myaccount.epicorsaas.com;User=username;Password=password;InitiateOAuth=GETANDREFRESH;")
Use SQL to create a statement for querying Epicor Kinetic. In this article, we read data from the Customers entity.
sql = "SELECT CustNum, Company FROM Customers WHERE CompanyName = 'CompanyName'"
With the query results stored in a DataFrame, we can use petl to extract, transform, and load the Epicor Kinetic data. In this example, we extract Epicor Kinetic data, sort the data by the Company column, and load the data into a CSV file.
table1 = etl.fromdb(cnxn,sql) table2 = etl.sort(table1,'Company') etl.tocsv(table2,'customers_data.csv')
In the following example, we add new rows to the Customers table.
table1 = [ ['CustNum','Company'], ['NewCustNum1','NewCompany1'], ['NewCustNum2','NewCompany2'], ['NewCustNum3','NewCompany3'] ] etl.appenddb(table1, cnxn, 'Customers')
With the CData Python Connector for Epicor Kinetic, you can work with Epicor Kinetic data just like you would with any database, including direct access to data in ETL packages like petl.
Download a free, 30-day trial of the CData Python Connector for Epicor Kinetic to start building Python apps and scripts with connectivity to Epicor Kinetic data. Reach out to our Support Team if you have any questions.
import petl as etl
import pandas as pd
import cdata.epicorerp as mod
cnxn = mod.connect("Service=Erp.BO.CustomerSvc;ERPInstance=MyInstance;URL=https://myaccount.epicorsaas.com;User=username;Password=password;InitiateOAuth=GETANDREFRESH;")
sql = "SELECT CustNum, Company FROM Customers WHERE CompanyName = 'CompanyName'"
table1 = etl.fromdb(cnxn,sql)
table2 = etl.sort(table1,'Company')
etl.tocsv(table2,'customers_data.csv')
table3 = [ ['CustNum','Company'], ['NewCustNum1','NewCompany1'], ['NewCustNum2','NewCompany2'], ['NewCustNum3','NewCompany3'] ]
etl.appenddb(table3, cnxn, 'Customers')
Download a Community License of the Epicor Kinetic Connector to get started:
Download NowLearn more:
👁 Epicor Kinetic IconPython Connector Libraries for Epicor Kinetic Data Connectivity. Integrate Epicor Kinetic with popular Python tools like Pandas, SQLAlchemy, Dash & petl.