This is a command line (CLI) tool in Python which tracks time (days, hours, minutes) since an event. This counter has two command line arguments: --view and --reset. I first wrote this program as a script, but I wanted to learn how to make CLI tools as the next step. So this is my first experience with building CLI tools.
- Python 3.x
- Python
-
Command line arguments with argparse - use the day counter with two simple commands:
--view(check the current counter)--reset(reset the counter or set the counter for the first time) -
File handling and data persistence - saves the time counter data in a JSON file
Follow these steps to download and run the program:
-
Clone the repository or click the green Code button, then select Download ZIP to download the repository
-
Extract the zip file to a folder on your computer
-
Open Terminal (macOS/Linux) or Command Prompt/Anaconda Prompt (Windows)
-
Navigate to the folder:
cd path/to/project -
Run the program:
python day_counter.py --resetpython day_counter.py --view
- Error handling with
try/except - Building a CLI tool with
argparsemodule from Python standard library
This project is licensed under the MIT License.