Skip to content

adam-malsagov/day-counter-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Day Counter

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.

βš™οΈ Requirements

  • Python 3.x

πŸ’» Tech Stack

  • Python

🌟 Features

  • 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

πŸš€ Getting Started

Follow these steps to download and run the program:

  1. Clone the repository or click the green Code button, then select Download ZIP to download the repository

  2. Extract the zip file to a folder on your computer

  3. Open Terminal (macOS/Linux) or Command Prompt/Anaconda Prompt (Windows)

  4. Navigate to the folder:

    cd path/to/project

  5. Run the program:

    python day_counter.py --reset

    python day_counter.py --view

πŸ“Έ Demo

scr1

πŸ“– What I Learned

  • Error handling with try/except
  • Building a CLI tool with argparse module from Python standard library

πŸ“„ License

This project is licensed under the MIT License.

About

A command line tool for tracking time since an event after entering a start time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages