{"id":19956067,"url":"https://github.com/dhhruv/todo","last_synced_at":"2025-05-03T19:32:35.287Z","repository":{"id":68312867,"uuid":"321919372","full_name":"dhhruv/todo","owner":"dhhruv","description":"This Script/Program is written as a part of CoronaSafe Engineering Fellowship Test Problem by Pupilfirst in the Python Programming Language passing all the test cases as given in the .js file. Proof of all Test Cases passing is as shown below.","archived":false,"fork":false,"pushed_at":"2021-05-14T07:43:27.000Z","size":54,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T20:56:16.486Z","etag":null,"topics":["algorithm","cli","coronasafe","fellowship","fellowship-internship-task","fellowship-python","internship-task","library","pupilfirst","python","shell","terminal","to-do","to-do-list","todo","todo-app","todo-cli","todolist"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhhruv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-16T08:36:27.000Z","updated_at":"2022-09-25T12:08:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c832a6f-c193-47b5-bb33-22651c3c5f22","html_url":"https://github.com/dhhruv/todo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhruv%2Ftodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhruv%2Ftodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhruv%2Ftodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhruv%2Ftodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhhruv","download_url":"https://codeload.github.com/dhhruv/todo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252242200,"owners_count":21717118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","cli","coronasafe","fellowship","fellowship-internship-task","fellowship-python","internship-task","library","pupilfirst","python","shell","terminal","to-do","to-do-list","todo","todo-app","todo-cli","todolist"],"created_at":"2024-11-13T01:29:57.270Z","updated_at":"2025-05-03T19:32:35.275Z","avatar_url":"https://github.com/dhhruv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Todo List Script..\n\nThis Script/Program is written as a part of CoronaSafe Engineering Fellowship Test Problem by Pupilfirst in the Python Programming Language passing all the test cases as given in the .js file. \u003cbr\u003e**Completed all Test cases in 4.8 seconds.**\n\n**Tested on Windows OS.**\u003cbr\u003e\n**Author: Dhruv Panchal**\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/72680045/103451547-3ed36900-4ceb-11eb-99a9-5ac160fb0314.PNG\" alt=\"Todo Working Proof\"\u003e\n\u003c/p\u003e\n\n## Getting started\n\n1. Install Python: Python is usually installed by default on most modern systems. To check what your currently have, open a terminal and run the following command\n    ```\n    python3 --version\n    ```\n    This should output some information on the installed Python version.\n    You can also install ruby by following these instructions. https://installpython3.com/\n\n2. You are expected to write the code in `todo.py` file.\n\n3. Once you are done with the changes you should be able to execute the todo app by running the following command from the terminal.\n\n   **On Windows:**\n\n   ```\n   todo.bat\n   ```\n\n## Run Automated Tests\n\n1. Install Node.js: You need to have npm installed in your computer for this problem. It comes with Node.js and you can get it by installing Node from https://nodejs.org/en/\n\n2. Run `npm install` to install all dependencies\n\n3. Create symbolic link to the executable file\n\n   **On Windows:**\n\n   ```\n   \u003e mklink todo todo.bat\n   ```\n   **Note: This is a mandatory step else you've to use `todo.bat` instead of `todo` in the Command Prompt in Windows OS.**\n\n4. Now run `npm test` and you will see all the tests failing. As you fill in each functionality, you can re-run the tests to see them passing one by one.\n\n## Specification\n\n1. The app can be run in the console with `./todo`.\n\n2. The app should read from and write to a `todo.txt` text file. Each todo item occupies a single line in this file. Here is an example file that has 2 todo items.\n\n    ```txt\n    water the plants\n    change light bulb\n    ```\n\n3.  When a todo item is completed, it should be removed from `todo.txt` and instead added to the `done.txt` text file. This file has a different format:\n\n    ```txt\n    x 2020-06-12 the text contents of the todo item\n    ```\n\n    1. the letter x\n    2. the current date in `yyyy-mm-dd` format\n    3. the original text\n\n    The date when the todo is marked as completed is recorded in the `yyyy-mm-dd` format (ISO 8601). For example, a date like `15th August, 2020` is represented as `2020-08-15`.\n\n    **Note:- Here I added something out of the box where `todo report` will generate the pending and completed tasks of the current day so if there are completed tasks in `done.txt` of days other than current day then they won't be counted in the report of current day.**\n\n4.  The application must open the files `todo.txt` and `done.txt` from where the app is run, and not where the app is located. For example, if we invoke the app like this:\n\n    ```\n    $ cd ~/plans\n    $ ~/apps/todo ls\n    ```\n    The application should look for the text files in `~/plans`, since that is the user’s current directory.\n\n    **Note:- To make the above specification work, I changed the `todo.bat` from**\n    ```\n    @echo off\n    python3 todo.py %1 %2\n    ``` \n    **to**\n    ```\n    @echo off\n    python \"%~dp0\\todo.py\" %1 %2\n    ```\n    **This will operate the `todo.py` Script from the Current Directory where the Command Prompt is used so the above mentioned specification is solved.**\n\n\n\n## Usage\n\n### 1. Help\n\nExecuting the command without any arguments, or with a single argument `help` prints the CLI usage.\n\n```\n$ ./todo help\nUsage :-\n$ ./todo add \"todo item\"  # Add a new todo\n$ ./todo ls               # Show remaining todos\n$ ./todo del NUMBER       # Delete a todo\n$ ./todo done NUMBER      # Complete a todo\n$ ./todo help             # Show usage\n$ ./todo report           # Statistics\n```\n**Note: If there are arguments after help for eg. `todo help abc` then it will throw an Exception due to given specifications in the Initial README and will recommend to use `todo help`.**\n\n### 2. List all pending todos\n\nUse the `ls` command to see all the todos that are not yet complete. The most recently added todo should be displayed first.\n\n```\n$ ./todo ls\n[2] change light bulb\n[1] water the plants\n```\n**Note: If there are arguments after ls for eg. `todo ls abc` then it will throw an Exception due to given specifications in the Initial README and will recommend to use `todo help`.**\n\n### 3. Add a new todo\n\nUse the `add` command. The text of the todo item should be enclosed within double quotes (otherwise only the first word is considered as the todo text, and the remaining words are treated as different arguments).\n\n```\n$ ./todo add \"the thing i need to do\"\nAdded todo: \"the thing i need to do\"\n```\n\n### 4. Delete a todo item\n\nUse the `del` command to remove a todo item by its number.\n\n```\n$ ./todo del 3\nDeleted todo #3\n```\n\nAttempting to delete a non-existent todo item should display an error message.\n\n```\n$ ./todo del 5\nError: todo #5 does not exist. Nothing deleted.\n```\n**Note: The Script will throw an Exception if the passed argument is not an integer for eg. `todo del abc` will throw an Exception so it is mandatory to pass an integer.**\n\n### 5. Mark a todo item as completed\n\nUse the `done` command to mark a todo item as completed by its number.\n\n```\n$ ./todo done 1\nMarked todo #1 as done.\n```\n\nAttempting to mark a non-existed todo item as completed will display an error message.\n\n```\n$ ./todo done 5\nError: todo #5 does not exist.\n```\n**Note: The Script will throw an Exception if the passed argument is not an integer for eg. `todo done abc` will throw an Exception so it is mandatory to pass an integer.**\n\n### 6. Generate a report\n\nUse the `report` command to see the latest tally of pending and completed todos.\n\n```\n$ ./todo report\ndd/mm/yyyy Pending : 1 Completed : 4\n```\n**Note: If there are arguments after report for eg. `todo report abc` then it will throw an Exception due to given specifications in the Initial README and will recommend to use `todo help`. Here I added something out of the box where `todo report` will generate the pending and completed tasks of the current day so if there are completed tasks in `done.txt` of days other than current day then they won't be counted in the report of current day.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhhruv%2Ftodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhhruv%2Ftodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhhruv%2Ftodo/lists"}