Skip to main content

A task management package that lets you add, complete, and fetch random tasks.

Project description

Python build & test

Python Package Exercise

Funtasks: A Task Management Package

This package was created by generally following the Packaging Python Projects guide, with the addition of pipenv for virtual environment management.

Overview

Funtasks is a simple and fun task management package designed to help you add, complete, and randomly select tasks. It includes features for adding tasks with urgency levels, marking tasks as complete, and generating random tasks or daily goals based on your available time.

Team Members

Natalie Ovcarov
Jun Li
Daniel Brito
Alvaro Martinez

Link to Our Package on PyPI

PyPI package Link

Functions Overview

  • add_task(task_name: str, urgency: int) -> str

    • Description: Adds a new task to the list with a specified urgency level.
    • Parameters:
      • task_name: The name of the task to add.
      • urgency: An integer representing the urgency level (1–5, with 5 being the most urgent).
    • Returns: A confirmation message upon successful addition.
    • Raises: ValueError if the task already exists.
    • Example:
      add_task("Do laundry", 3)
      
  • complete_task(task_name: str) -> str

    • Description: Marks a task as completed.
    • Parameters:
      • task_name: The name of the task to complete.
    • Returns: A confirmation message or a message indicating the task doesn't exist.
    • Example:
      complete_task("Do laundry")
      
  • random_task() -> str

    • Description: Retrieves a random task from the list.
    • Returns: The name of a random task or a message indicating there are no tasks.
    • Example:
      random_task()
      
  • random_daily_goal(available_time: int) -> str

    • Description: Suggests a task based on the available time.
    • Parameters:
      • available_time: Time available in minutes (used to determine task urgency).
    • Returns: A task that fits the time constraint or a message indicating no tasks are suitable.
    • Example:
      random_daily_goal(25)
      

How to Install and Use This Package

Platform Configuration

  • Windows users: Use python and pip commands instead of python3 and pip3 where necessary.

    pip install pipenv
    python your_program_filename.py
    
  • macOS/Linux users: Ensure Python 3 is installed and use python3.

    pip3 install pipenv
    python3 your_program_filename.py
    
  1. Install pipenv (if not already installed):

    pip3 install pipenv
    
  2. Install the package:

    pip3 install funtasks
    
  3. Activate the virtual environment:

    pipenv shell
    
  4. Create a Python program file to import and use the package:

    from funtasks.tasks import add_task, complete_task, random_task, random_daily_goal
    add_task("Tell a joke", 2)
    complete_task("Tell a joke")
    print(random_task())
    print(random_daily_goal(25))
    
  5. Run the program:

    python3 your_program_filename.py
    
  6. Exit the virtual environment:

    exit
    

Alternative: Run the Package Directly

  1. Create and activate a pipenv virtual environment.
  2. Run the package directly:
    python3 -m funtasks
    
  3. Exit the virtual environment:
    exit
    

How to Run Unit Tests

We've included three unit tests for each function in the funtasks package. To run these tests:

  1. Install pytest in the virtual environment:
    pipenv install pytest
    
  2. Run the tests from the main project directory:
    python3 -m pytest
    
  3. Verify all tests pass to ensure correct functionality.

How to Contribute to Funtasks

Prerequisites

Make sure you have Python 3.9 or higher installed:

python3 --version
  1. Clone the repository:

    git clone https://github.com/software-students-fall2024/3-python-package-java_and_the_scripts_.git
    
  2. Enter the directory:

    cd 3-python-package-java_and_the_scripts_
    
  3. Set up a virtual environment using pipenv:

    pipenv install --dev
    
  4. Activate the virtual environment:

    pipenv shell
    
  5. Modify and run the file:

    python -m funtasks
    

    If you want to run a specific file (like tasks.py), use:

    python funtasks/tasks.py
    
  6. Run tests:

    pipenv run pytest
    
  7. Build the package:

    python3 -m build
    
  8. Exit the virtual environment:

    exit
    

Continuous Integration

This project has a continuous integration workflow that builds and runs unit tests automatically with every push to GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funtasks-0.1.20.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

funtasks-0.1.20-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file funtasks-0.1.20.tar.gz.

File metadata

  • Download URL: funtasks-0.1.20.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for funtasks-0.1.20.tar.gz
Algorithm Hash digest
SHA256 7a2e304a95ae58a72dae53224e498a1fc87fba3a22a46f67464b588401a050fd
MD5 54e7b0d45f94a1f98ffa197415ddc205
BLAKE2b-256 85e8fdc955b531c2e60e72bb5a15dc0fcb5f02f7710796a66b806c37c02ed99a

See more details on using hashes here.

File details

Details for the file funtasks-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: funtasks-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for funtasks-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 6e02c0f5701ec5171ff01ddd1f004e68f68b803e45d9b4470ae7b2123f0c8def
MD5 69b6436c226b821a5791f5087e2c3764
BLAKE2b-256 9b166ff1be6330caca59cd87cd00cd07176c79f4f2ee4ec7014ecfcd78502344

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page