βοΈ To Do AppΒΆ
Classes:
|
To-Do List Implementation with Big Tree. |
- class bigtree.workflows.app_todo.AppToDo(app_name: str = '')ΒΆ
Bases:
object- 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.
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]
Methods:
add_item(item_name[,Β list_name])Add items to list
add_list(list_name,Β **kwargs)Add list to app
load(json_path)Load To-Do app from json
prioritize_item(item_name)Prioritize item in list, shift it to be the first item in list
prioritize_list(list_name)Prioritize list in app, shift it to be the first list
remove_item(item_name[,Β list_name])Remove items from list
save(json_path)Save To-Do app as json
show(**kwargs)Print tree to console
- add_item(item_name: str | List[str], list_name: str = '', **kwargs: Any) NoneΒΆ
Add items to list
- Parameters:
item_name (str/List[str]) β items to be added
list_name (str) β list to add items to, optional
- add_list(list_name: str, **kwargs: Any) NodeΒΆ
Add list to app
If list is present, return list node, else a new list will be created
- Parameters:
list_name (str) β name of list
- Returns:
(Node)
- static load(json_path: str) AppToDoΒΆ
Load To-Do app from json
- Parameters:
json_path (str) β json load path
- Returns:
(Self)
- prioritize_item(item_name: str) NoneΒΆ
Prioritize item in list, shift it to be the first item in list
- Parameters:
item_name (str) β name of item
- prioritize_list(list_name: str) NoneΒΆ
Prioritize list in app, shift it to be the first list
- Parameters:
list_name (str) β name of list
- remove_item(item_name: str | List[str], list_name: str = '') NoneΒΆ
Remove items from list
- Parameters:
item_name (str/List[str]) β items to be added
list_name (str) β list to add items to, optional
- save(json_path: str) NoneΒΆ
Save To-Do app as json
- Parameters:
json_path (str) β json save path
- show(**kwargs: Any) NoneΒΆ
Print tree to console