Skip to content

A package that will get Trello data organized by label rather than by board

License

Notifications You must be signed in to change notification settings

kjgcoop/trello-label-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trello-label-package

Trello's labels are per board, so you can't see all the tasks with a given label. Rather than hopping between boards, you can use this script to loop through the labels.

Getting Started

// Give the object enough information to connect to Trello
$batch = new TrelloLabelBatch([Trello API key], [Trello API token], [Trello user whose data you're interested in]);

// Grab the data
$batch->populate();

// You may now work with the data.

foreach ($batch->get_labels() as $label) {
    foreach ($label->get_cards() as $card) {
        // Whatever you want to do.
    }
}

The script assumes that you only want to deal in one user's boards.

Notes on Data

A populated batch represents an array of all your labels, each containing the relevant cards.

  • A TrelloLabel object has a color, a name and a list of cards
  • A TrelloCard object has a name, board name and list of labels.

Any given card may appear any number of times.

  • If a card has no labels, it won't appear in the data structure. While Trello boards have a list of its labels, this generates its list by looping through existing cards.
  • If a card has more than one label applied, the card will appear in memory once per label.

Prerequisites

PHP and the PHP Curl Extension and Composer. All the other dependencies are handled by Composer.

Built With

License

This is licensed under the GPL License

About

A package that will get Trello data organized by label rather than by board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages