Skip to main content

Python Trello API

trello.py is a simple Python API that is used to communicate with Trello. It is an Object-Oriented API and uses the Trello Rest API.

This API is insipired by LisaF854's Roblox-Trello | Object Oriented Trello API. It uses a similar structure to that API, so you will notice many of the functions there are applied to this API.

This API has easy and user-friendly functions that do a lot of the task you would do normally yourself. More functions will be added in the future in case they are needed.

Getting Started

To use the this API, first install it from PyPI using pip:

pip install trello.py

or downloading from the GitHub page and run the code in your directory:

python setup.py install

This API requires both an app key and a token in order to work. To get your app key, simply go to https://trello.com/app-key and grab the app key generated. Keep it stored somewhere for now because you will need to access it later.

Once you have your app key, you will need to get your app token as well. You can visit https://trello.com/1/authorize?expiration=never&scope=read,write&response_type=token&name=Trello.py%20Access&key=YOUR_KEY_HERE in order to get your token. Make sure that you replace YOUR_KEY_HERE with your app key. Once you have authorized it, it will give you your token. Store that token somewhere as well.

WARNING: You should only share your token with people that you trust. Your token is like the password of your account and the app key is the username. If your app key is ever leaked, it should not cause many issues, but it is recommended that you change it. On the other hand, if your token is in fact leaked, make sure to remove access to it immediately and generate a new one. If a person has your token, then they have access to your account (via code) and have the ability to do anything that you can do. Make sure it is always kept in a safe place and hidden from the public.

The following code is an example of importing the Trello API (as Trello), retrieving board by it's name, and getting the board's data.

    from trello import TrelloAPI as Trello

    MyTrello = Trello("YOUR_APP_KEY", "YOUR_TOKEN")
    Board = MyTrello.GetBoardByName("Your Board Name")
    BoardData = Board.GetData()
(Note: Trello does support OAuth, but the Python API does not have any support for it yet.)

Basic Info

You can think of the Trello class as the account. You should only have one instance of Trello initialized in your script. Although it is allowed, it is not recommended to have more than one instances of Trello.

The Trello instance comes with three basic functions:

  • GetBoardByName(String BoardName) - Gets a board by it's name
  • GetBoardById(String BoardId) - Gets a board by it's ID
  • new(String Type, String Name, Object Parent) - Creates a new object (Board, List, Card) with the given name. If it is a List object, then the parent must be a Board object, which is the board that the list will be in. If it is a Card object, then the parent must be a List object, which is the list that the list will be in. If it is a board, ten you can leave it blank

Currently, there are five types of objects, Trello, Board, List, Card, and Label. Each object has it's own functions that relate to it, with all of them (except Trello) having some common functions which are;

  • GetId() - Gets the ID of the object
  • GetData(String Param (OPTIONAL)) - Gets the object's data in JSON. The Param parameter is optional. It is basically an extention to the pre-made URL for special requests, like lists of cards or labels
  • SetProperty(String Property, String Value) - Sets the value of the Property of the object to Value. It isn't recommended that you use this function. Only use when needed to
  • ClassName() - Returns the class name of the object (Board, List, Card, or Label)

Bugs, Reports, and Suggestions

Keep in mind that this API is in its early stages. It will have bugs and that is something that is common to early versions. If you find any bugs or have any suggestions, please send them directly to me via Discord or create a bug report or suggestion on the GitHub page (W.I.P.). If you contact me through Discord, my username is Batman212369#5703.

NOTE: Yes, I know that currently there aren't any checkings (doesn't check for errors nor if the input is the correct type) when calling methods. This will be added soon, but for now just use the API responsibly and you should not get any errors.

Release files for trello.py 0.0.6.post4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trello.py 0.0.6.post4
File Size Uploaded
trello.py-0.0.6.post4.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trello.py 0.0.6.post4
File Interpreter ABI Platform
trello.py-0.0.6.post4-py3-none-any.whl Python 3 none any Details

Total release size:11.9 kB

Release files / trello.py-0.0.6.post4.tar.gz

Download URL trello.py-0.0.6.post4.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f01b8f3854070a692a5ffc4949f896efd4a939f2867b2f91e7b5d335c1697edb
BLAKE2b-256 checksum
How to use checksums
0fd0809de9c4c507be3372b3b3a6dc333be93d81898a6a3933178d654e4ba8d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

Release files / trello.py-0.0.6.post4-py3-none-any.whl

Download URL trello.py-0.0.6.post4-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99ffa5f743544cdeca57d96c4f5e33e356a73ae0c1a758e3cdacb08901f4386b
BLAKE2b-256 checksum
How to use checksums
3f013c0abc05ac90bc313f65af1353af8e227db2d3889f98080b84ee50535922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page