Ready to get started?

Download a free trial of the Trello Driver to get started:

 Download Now

Learn more:

Trello Icon Trello JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Trello data including List, Cards, Boards, and more!

Use JayDeBeApi to access Trello Data in Python



Use standard Python scripting and the development environment of your choice to access live Trello data.

Access Trello data with Python scripts and standard SQL on any machine where Python and Java can be installed. You can use the CData JDBC Driver for Trello and the JayDeBeApi module to work with remote Trello data in Python. By using the CData Driver, you are leveraging a driver written for industry-proven standards to access your data in the popular Python language. This article shows how to use the driver to execute SQL queries to Trello and visualize Trello data with standard Python.

Use the JayDeBeApi module

JayDeBeApi is a Python library that serves as a JDBC (Java Database Connectivity) bridge, allowing Python programs to interact with Java databases, including CData JDBC Drivers. Use the pip install command to install the module:

pip install JayDeBeApi

Create the JDBC URL

Once you have JayDeBeApi installed, you are ready to work with Trello data in Python using SQL.

Trello uses token-based authentication to grant third-party applications access to their API. When a user has granted an application access to their data, the application is given a token that can be used to make requests to Trello's API.

Trello's API can be accessed in 2 different ways. The first is using Trello's own Authorization Route, and the second is using OAuth1.0.

  • Authorization Route: At the moment of registration, Trello assigns an API key and Token to the account. See the Help documentation for information on how to connect via the Authorization route.
  • OAuth Route: Similar to using Authorization, OAuth creates an Application Id and Secret when you create your account. See the Help documentation for information on how to to connect.

Built-in Connection String Designer

For assistance in constructing the JDBC URL, use the connection string designer built into the Trello JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

java -jar cdata.jdbc.trello.jar

Fill in the connection properties and copy the connection string to the clipboard.

Below is a sample variable assignment, including a typical JDBC connection string:

jdbc_url = "jdbc:trello:APIKey=myApiKey;Token=myGeneratedToken;InitiateOAuth=GETANDREFRESH"

Access Trello data in Python

With the JDBC URL configured, you only need the absolute path to the JDBC driver JAR file, which is in the "lib" folder in the installation directory ("C:\Program Files\CData[product_name] 20XX\lib\cdata.jdbc.trello.jar" on Windows).

NOTE: If you haven't already, set the JAVA_HOME environment variable to the Java installation directory.

Use code similar to the follow to read and print data from Trello:

import jaydebeapi #The JDBC connection string jdbc_url = "jdbc:trello:APIKey=myApiKey;Token=myGeneratedToken;InitiateOAuth=GETANDREFRESH" username = "****" password = "****" #The absolute Path to the JDBC driver JAR file, typically: jdbc_driver_jar = "C:\Program Files\CData[product_name] 20XX\lib\cdata.jdbc.trello.jar" conn = jaydebeapi.connect( "cdata.jdbc.trello.jar", jdbc_url, [username, password], jdbc_driver_jar, ) cursor = conn.cursor() cursor.execute("SELECT * FROM Boards;") results = cursor.fetchall() for row in results: print(row) cursor.close() conn.close()

Free trial & more information

Download a free, 30-day trial of the CData JDBC Driver for Trello and start working with your live Trello data in Python. Reach out to our Support Team if you have any questions.