βοΈ To Do App
bigtree.workflows.app_todo
AppToDo
To-Do List Implementation with Big Tree.
- To-Do List has three levels - app name, list name, and item name.
- If list name is not given, item will be assigned to a General
list.
Examples:
Initializing and Adding Items
>>> from bigtree import AppToDo
>>> app = AppToDo("To Do App")
>>> app.add_item(item_name="Homework 1", list_name="School")
>>> app.add_item(item_name=["Milk", "Bread"], list_name="Groceries", description="Urgent")
>>> app.add_item(item_name="Cook")
>>> app.show()
To Do App
βββ School
β βββ Homework 1
βββ Groceries
β βββ Milk [description=Urgent]
β βββ Bread [description=Urgent]
βββ General
βββ Cook
Reorder List and Item
>>> app.prioritize_list(list_name="General")
>>> app.show()
To Do App
βββ General
β βββ Cook
βββ School
β βββ Homework 1
βββ Groceries
βββ Milk [description=Urgent]
βββ Bread [description=Urgent]
>>> app.prioritize_item(item_name="Bread")
>>> app.show()
To Do App
βββ General
β βββ Cook
βββ School
β βββ Homework 1
βββ Groceries
βββ Bread [description=Urgent]
βββ Milk [description=Urgent]
Removing Items
>>> app.remove_item("Homework 1")
>>> app.show()
To Do App
βββ General
β βββ Cook
βββ Groceries
βββ Bread [description=Urgent]
βββ Milk [description=Urgent]
Exporting and Importing List
>>> app.save("assets/docstr/list.json")
>>> app2 = AppToDo.load("assets/docstr/list.json")
>>> app2.show()
To Do App
βββ General
β βββ Cook
βββ Groceries
βββ Bread [description=Urgent]
βββ Milk [description=Urgent]
Initialize To-Do app
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_name |
str
|
name of to-do app, optional |
''
|
add_list
Add list to app
If list is present, return list node, else a new list will be created
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_name |
str
|
name of list |
required |
Returns:
Type | Description |
---|---|
Node
|
(Node) |
prioritize_list
Prioritize list in app, shift it to be the first list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
list_name |
str
|
name of list |
required |
add_item
Add items to list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str / List[str]
|
items to be added |
required |
list_name |
str
|
list to add items to, optional |
''
|
remove_item
Remove items from list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str / List[str]
|
items to be added |
required |
list_name |
str
|
list to add items to, optional |
''
|
prioritize_item
Prioritize item in list, shift it to be the first item in list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of item |
required |
load
staticmethod
Load To-Do app from json
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_path |
str
|
json load path |
required |
Returns:
Type | Description |
---|---|
AppToDo
|
(Self) |