Skip to content

βœ”οΈ To Do App


bigtree.workflows.app_todo

AppToDo

AppToDo(app_name='')

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(list_name, **kwargs)

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(list_name)

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_item(item_name, list_name='', **kwargs)

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_item(item_name, list_name='')

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(item_name)

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

show

show(**kwargs)

Print tree to console

load staticmethod

load(json_path)

Load To-Do app from json

Parameters:

Name Type Description Default
json_path str

json load path

required

Returns:

Type Description
AppToDo

(Self)

save

save(json_path)

Save To-Do app as json

Parameters:

Name Type Description Default
json_path str

json save path

required