bigtree

βœ”οΈ To Do AppΒΆ

Classes:

AppToDo([app_name])

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