8000 GitHub - ONEONUORA/Habit-Tracker: Assignments for the course: Object Oriented and Functional Programming with Python (DLBDSOOFPP01) For IU
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Assignments for the course: Object Oriented and Functional Programming with Python (DLBDSOOFPP01) For IU

Notifications You must be signed in to change notification settings

ONEONUORA/Habit-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Habit Tracker

A simple and effective Habit Tracker built with Python. This application allows users to track and analyze their daily and weekly habits, set goals, and monitor their progress over time.

Features

  • Create Habits: Create new daily and weekly habits.
  • Track Habit Completion: Mark tasks as completed for daily/weekly habits.
  • Analytics: Analyze your habit progress with streaks and completion data.
  • Persistent Data Storage: Habit data is stored in a file to retain progress between sessions.
  • Command-line Interface (CLI): Interact with the habit tracker through a simple CLI.

Requirements

  • Python 3.7 or later
  • pytest or unittest for testing purposes

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/ONEONUORA/Habit-Tracker.git
    cd habit-tracker
  2. Set up a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:
    .\venv\Scripts\activate
    • On macOS/Linux:
    source venv/bin/activate
  4. Install the dependencies:

     pip install -r requirements.txt

Usage

  1. Create a Habit

    To create a habit, use the following command:

    python main.py create-habit

    You'll be prompted to enter:

    • Habit name
    • Habit description
    • Habit period (daily or weekly)

    Example:

    $ python main.py create-habit
    Habit name: Exercise
    Habit description: Morning workout
    Habit period (daily/weekly): daily
  2. Complete a Habit

    To mark a habit as completed, use the following command:

    python main.py complete-habit
    habit name:

    Example:

    $ python main.py complete-habit --name "Exercise"
  3. List All Habits

    To list all currently tracked habits:

    python main.py list-habits
  4. List Habits by Period

    To list habits based on their periodicity (daily or weekly):

    python main.py list-habits-by-period --period "daily"
  5. View Analytics

    To view the longest streak for all habits:

    python main.py longest-overall-streak

    To view the longest streak for a specific habit:

    python main.py longest-streak
    
       Habit name: "Enter habit name"

Tests

Unit tests are provided for the core functionality of the Habit Tracker. To run the tests, use pytest:

  1. Install pytest if you haven't already:
pip install pytest
  1. Run the tests:
pytest

Project Structure

 habit-tracker/
├── src/
│   ├── analytics/
│   │   └── analyzer.py
│   ├── cli/
│   │   └── interface.py
│   ├── models/
│   │   └── habit.py
│   ├── storage/
│     └── database.py
│
├── tests/
│   └── test_analytics.py
|    |__test_database.py
│   └── test_habit.py
└── README.md
|___requirements.txt
|__ main.py

Contributing

If you'd like to contribute to this project, feel free to open an issue or submit a pull request.

Fork the repository.

Create a new branch (git checkout -b feature-name).

Commit your changes (git commit -am 'Add feature').

Push to the branch (git push origin feature-name).

Create a new pull request.

License

This project is licensed under the MIT License.

### Key Sections in the README:

- **Features**: Highlights the core functionality of the project.
- **Installation**: Provides clear steps on how to set up the project.
- **Usage**: Describes how to interact with the Habit Tracker via the command line.
- **Tests**: Instructions for running unit tests.
- **Project Structure**: Shows the layout of the project files and directories.
- **Contributing**: Encourages open-source collaboration with contribution guidelines.
- **License**: Indicates that the project is licensed under the MIT License.

---

About

Assignments for the course: Object Oriented and Functional Programming with Python (DLBDSOOFPP01) For IU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0