Git Product home page Git Product logo

habittracker_python's Introduction

A Habit Tracker CLI Tool build with Python

Conception and construction of a CRUD habit tracker with some analytical functionality. -> Backend + CLI

Functionality

The core functionality of the habit tracker are:

  • Add habit
  • Remove habit
  • Add a description of the habit
  • Define the tracking frequency of habits (Daily or weekly)
  • Checkoff a habit once it is done for its frenquence
  • get a reminder if a habid period got missed
  • get some congratulation if a habit successfully got tracked for 2 weeks

The tracker allows some analytical actions like:

  • View all habits from the DB and its core data
  • View all habits from the DB specified by a certain linked periodicity
  • View the longest streak of all habits
  • return the longest streak for a given habit

Getting Started

Make sure Python 3.12 + is installed on your OS.

Dependencies

  • Python 3.12 +
  • Questionary
  • sqlite3 (already included in the python package)
  • datetime

Installing

Check your local python version and if required download the latest version of Python from this link - [Make sure to check "ADD to path" in the Python installer.]

After installing Python, proceed with the installation of the following libraries:

  • Questionary

      pip install questionary
    
  • datetime

      pip install datetime
    

Testing

To ensure the validity of the habit tracker, its habit tracking components and the analytics module get tested by a unit test suite. To run the tests, you will need the following packages installed: Pytest - For testing functions:

pip install -U pytest

Also change the Database from main.db to test.db.

How To Run the Program

Upon completing the installation of the necessary dependencies, download the files from this repository and store them in a separate folder. Access your terminal and navigate to the downloaded folder. Input the following command to run the program:

python3 main.py

Now the habit tracker CLI will be launched and you can follow the displayed options in the CLI.

Database

There are 5 predefined habits that the user can delete later.

Running tests

To run the test, navigate to the test folder and type

pytest

Usage

Add/Remove Habit

Follow the instructions on your CLI after starting the programm. For navigation use the arrow-keys of your keyboard. Confirm with the enter-key.

Modify/Update a Habit

The user can edit the descriptiption or the habit frequency.

Check Off a habit

The user is asked to check off a habit at least once in the predefined periodicity. He can do so by selecting this option from the main menu. A habit can just be checked off once in a period. The checking off of a habit gets registered by the period_count by +1. The period count resets to 0 if a habit gets missed in the preset period. In the period_archive the highest value of the period counter gets stored in a list. Like that the trackking data can be analyzed later.

Show Habits

Shows a table of all the stored habits along with their information of Name, Description, Periodicity.

Analysis

The following operations can get analysed by the habit tracker:

  • return a list of all currently tracked habits.
    • return a list of all habits with the same frequency (daily, weekly).
    • return the longest run streak of all defined habits (โ†’ checks the streak_archive and streak_count for the highest nr among all habits)
    • return the longest streak for a given habit (โ†’ checks the streak_archive and streak_count of a given habit)

habittracker_python's People

Contributors

samox03 avatar

Watchers

 avatar

habittracker_python's Issues

Write the composite presentation PDF (5-10 Slides)

During the implementation phase you must submit an explanation of your design and implementation procedure as a composite presentation PDF with about 5-10 slides.

  • The file should contain visual elements that facilitate comprehension,
  • it needs to be structured and explain which tools you decided to use.

While in the first phase you were scoping out an internal design document shared with your colleagues, think of this presentation as a customer-facing document. You as core developer explain to your potential customer base what components and features your application has and how to use them.

The PDF will be uploaded in the PebblePad template, the text field in the template can be left empty.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.