Skip to content

(Unofficial) Julia library for working with Trello

License

Notifications You must be signed in to change notification settings

oxinabox/Trello.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trello lifecycle: Maturing

Stable Dev Build Status Codecov

This is an unofficial julia client for Trello.

It is not a direct wrapper of the Trello REST API, but it is close. It tries to be a little more convenient for typical use cases. (For example, cards and lists are sorted as they apppear in the web-app. Archived cards are not shown). For more direct control, use the Trello.request function, which will just call the API, and not do any post/preprocessing.

The API is not complete, you can find what operations we currently have in the docs. It is very easy to add any method, as you need it. Generally just a few lines of code, after reading the API docs. PRs are welcome, and easy to make.

In general methods are prefixed with:

  • create_[item]: e.g. create_card
  • get_[items]: e.g. get_lists
  • delete_item: e.g. delete_board It should be fairly obvious what they do. They all have docstrings.

The methods all tend to return a NamedTuple response, or a ordered dictionary of items indexed by name. Where each item is a NamedTuple. This means that calling values(get_[items](...)) will return a valid Tables.jl Table.

Demo:

Here we demo:

  • instantiating credentials
  • creating a board
  • creating a list
  • adding some cards to that list
  • reading them back down
  • rendering them as a DataFrame.
julia> using Trello

julia> cred = TrelloCred()
TrelloCred(<secrets>)

julia> board_resp = create_board(cred, "ZZZ_Demo");

julia> list_resp = create_list(cred, board_resp.id, "Tasks")
(id = "5d72175351f2b73b0f872e03", name = "Tasks", closed = false, idBoard = "5d721712fa52696736da60c
f", pos = 16384, limits = NamedTuple())

julia> asyncmap(1:10) do task_num
       create_card(cred, list_resp.id, "Task $task_num"; desc="This is a important task")
       end;

julia> cards = get_cards(cred, list_resp.id)
OrderedCollections.LittleDict{String,Any,Array{String,1},Array{Any,1}} with 10 entries:
  "Task 1"  => (id = "5d7217c13e1a40802d3e9006", checkItemStates = nothing, closed = false, dateLas
  "Task 2"  => (id = "5d7217c1c402bc42ee4a48dc", checkItemStates = nothing, closed = false, dateLas
  "Task 3"  => (id = "5d7217c1f2b19a406863da02", checkItemStates = nothing, closed = false, dateLas
  "Task 5"  => (id = "5d7217c2675c6e89ed791d40", checkItemStates = nothing, closed = false, dateLas
  "Task 6"  => (id = "5d7217c24ee7670139e47d1b", checkItemStates = nothing, closed = false, dateLas
  "Task 4"  => (id = "5d7217c205088042e3ebd126", checkItemStates = nothing, closed = false, dateLas
  "Task 8"  => (id = "5d7217c2d6c9253eff228fe8", checkItemStates = nothing, closed = false, dateLas
  "Task 7"  => (id = "5d7217c254fe39741b79371d", checkItemStates = nothing, closed = false, dateLas
  "Task 9"  => (id = "5d7217c24f080a5833454150", checkItemStates = nothing, closed = false, dateLas
  "Task 10" => (id = "5d7217c31b352132d291f077", checkItemStates = nothing, closed = false, dateLas

julia> df = DataFrame(values(cards))
10×27 DataFrame. Omitted printing of 22 columns
│ Row │ id                       │ checkItemStates │ closed │ dateLastActivity         │ desc                     │
│     │ String                   │ Nothing         │ Bool   │ String                   │ String                   │
├─────┼──────────────────────────┼─────────────────┼────────┼──────────────────────────┼──────────────────────────┤
│ 15d7217c13e1a40802d3e9006 │                 │ 02019-09-06T08:24:33.278Z │ This is a important task │
│ 25d7217c1c402bc42ee4a48dc │                 │ 02019-09-06T08:24:33.574Z │ This is a important task │
│ 35d7217c1f2b19a406863da02 │                 │ 02019-09-06T08:24:33.826Z │ This is a important task │
│ 45d7217c2675c6e89ed791d40 │                 │ 02019-09-06T08:24:34.044Z │ This is a important task │
│ 55d7217c24ee7670139e47d1b │                 │ 02019-09-06T08:24:34.284Z │ This is a important task │
│ 65d7217c205088042e3ebd126 │                 │ 02019-09-06T08:24:34.463Z │ This is a important task │
│ 75d7217c2d6c9253eff228fe8 │                 │ 02019-09-06T08:24:34.596Z │ This is a important task │
│ 85d7217c254fe39741b79371d │                 │ 02019-09-06T08:24:34.773Z │ This is a important task │
│ 95d7217c24f080a5833454150 │                 │ 02019-09-06T08:24:34.991Z │ This is a important task │
│ 105d7217c31b352132d291f077 │                 │ 02019-09-06T08:24:35.103Z │ This is a important task │

julia> delete_board(cred, board_resp.id)
(_value = nothing,)

About

(Unofficial) Julia library for working with Trello

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages