Package: todopkg
Python Package Exercisetodopkgtodopkgis a Python package for managing and organizing to-do lists with prioritization and due dates. This package allows for easy creation, modification, and deletion of to-do lists and tasks.FeaturesCreate multiple to-do listsAdd tasks with optional priority and due dateModify list namesDelete tasks and listsSave and load lists from a fileCommand-line friendly display with table formattingPyPIClickHereto viewtodopkgon PyPI.How to UsetodopkgInstalling PythonPlease make sure you have Python 3.9 or above on your local machine, you can get the latest Python from itsofficial website.InstallingtodopkgTo installtodopkgvia pip, run:pipinstalltodopkgImporttodopkgAfter installingtodopkg, you can importtodopkgto your program using:fromtodopkgimportTodoListManagerDocumentation and InstructionCreate a to-do list instance:When you instantiate the manager, you have the option to specify the filename for saving and loading your to-do lists, as well as control the auto-restore feature that automatically loads existing to-do lists at startup.filename: This optional parameter allows you to specify the name and path of the file where your to-do lists will be saved (it needs to be a json file). By default, it is set to 'todolist.json'.enable_auto_restore: Also optional, this flag lets you decide whether to automatically load the to-do lists from the specified file when the manager is created. It is enabled by default.Default:todo_manager=TodoListManager()Use custom storage file:todo_manager=TodoListManager(filename=my_file.json)Disable auto restore:todo_manager=TodoListManager(enable_auto_restore=False)Use custom storage file and Disable auto restore:todo_manager=TodoListManager(filename=my_file.json,enable_auto_restore=False)Create a new to-do list:Different to-do lists need to have distinct names.Create a to-do list named 'Groceries':todo_manager.create_todo_list('Groceries')Create another to-do list named 'Homeworks':todo_manager.create_todo_list('Homeworks')Add items to the to-do list:To add an item to your to-do list, you'll use theadd_item_to_todo_listfunction. You need to specify the name of the list and the item you wish to add.  Items may be assigned a priority level (int) or a due date (YYYY-MM-DD), or both, and will be displayed in sorted order accordingly. When both are specified, priority ranking takes precedence over the due date.Without priority or due date:todo_manager.add_item_to_todo_list('Groceries','Apples')With priority only (the lower the number, the higher the priority):todo_manager.add_item_to_todo_list('Homeworks','Midterm Review',priority=1)With due date only (due date in format "YYYY-MM-DD"):todo_manager.add_item_to_todo_list('Homeworks','Essay',due_date="2023-11-10")With both priority and due date:todo_manager.add_item_to_todo_list('Homeworks','Essay',priority=2,due_date="2023-11-10")Remove items from the to-do list:To remove an item, you need to specify the list name and the index of the item usingremove_item_from_todo_listfunction. Indexing starts at 0, so to remove the first item, you would use index 0.todo_manager.remove_item_from_todo_list('Groceries',0)Update to-do list name:If you need to rename a to-do list, provide the current name followed by the new name to thechange_todo_list_namefunction.todo_manager.change_todo_list_name('Groceries','Supermarket')Delete to-do list:To completely remove a to-do list, simply provide the name of the list to thedelete_todo_listfunction.todo_manager.delete_todo_list('Supermarket')Show all to-do list:Theshow_all_todo_listfunction returns a dictionary containing all to-do lists with their items. Each key in the dictionary is a list name, and its value is a list of tasks.todo_manager.show_all_todo_list()You can manipulate this dictionary however you like to integrate with your application. It provides a 'raw' format for advanced usage and flexibility.Print all to-do lists:Theprint_all_todo_listsfunction provides a nicely formatted table output to the console for one or all of your to-do lists. You can either print all lists or specify a single list to print by name.print all to-do lists:todo_manager.print_all_todo_lists()print a specific to-do list:todo_manager.print_all_todo_lists(list_name='Groceries')Displaying all items in a to-do list:To view all the items within a specific to-do list in a formatted, readable manner, you can use theshow_all_items_in_todo_listfunction, pass the list's name as the parameter.todo_manager.show_all_items_in_todo_list('Groceries')Save to-do lists to a JSON file:Save your to-do lists to a JSON file specified at the beginning using thesave_to_filefunction. This functions is invoked automatically before program exit.todo_manager.save_to_file()Load to-do lists from a JSON file:Restore your to-do lists from a JSON file specified at the beginning usingload_from_filefunction. This function is automatically invoked upon instantiation ofTodoListManagerifenable_auto_restoreisTrue.todo_manager.load_from_file()Example ProgramFor a full example program that utilizes all functionalities, kindly refer toExample TodoList Usage.You can also run this file following this procedure:Clone the repository and cd to the project root directory:gitclonehttps://github.com/software-students-fall2023/3-python-package-exercise-isomorphism1337.gitcd3-python-package-exercise-isomorphism1337Installpipenvif you don't have one on your machine:pipinstallpipenvInstall the dependencies:pipenvinstall--dev
pipenvshellRun the example file:python-msrc.todopkgHow to contribute totodopkgPrerequisitesPython 3.9+Initial SetupClone the repository and cd to the project root directory:gitclonehttps://github.com/software-students-fall2023/3-python-package-exercise-isomorphism1337.gitcdYou_Own_Directory/3-python-package-exercise-isomorphism1337Installpipenvif you don't have one on your machine:pipinstallpipenvInstall the dependencies:pipenvinstall--dev
pipenvshellMaking ChangesCreate a new branch for your feature or fix:gitcheckout-byour-branch-nameMake your changes to the codebase. Remember to adhere to the       project's coding standards and guidelines.If you've added new code, consider writing tests that cover your changes in thetestsfolder. This is important to ensure that your code works as expected and future changes don't break your implementation.Running TestsAfter making changes, run all tests to ensure that your changes don't break any existing functionality:pipenvrunpytestCommiting Your ChangesAdd your changes to staging, then commit your changes with a descriptive message:gitadd.gitcommit-m"Your detailed description of the changes"Pushing ChangesPush your changes to your branch:gitpushoriginyour-branch-nameSubmitting a Pull RequestCreate a new pull request for your branch, and we will review your code later.After Your Pull Request is MergedPull the changes from the original repository:gitcheckoutmain
gitpulloriginmainDelete your old branch:gitbranch-dyour-branch-name
gitpushorigin--deleteyour-branch-nameContributorsJiasheng wangFuzhen LiXuefeng SongYuantian TanConclusionThank you for taking the time to explore our project. We hope it serves your needs and contributes positively to your work. If you have any questions or feedback, feel free to reach out to us viaGitHub Discussionsfor our repository. We appreciate your interest and support!