"""Utility functions for working with catalog information.

Author:
Version:
"""

import json
import textwrap


def parse_credits(credits):
    """Return a tuple of ints representing the possible credit values.

    Examples:
    >>> parse_credits("3")
    (3,)
    >>> parse_credits("1-4")
    (1, 2, 3, 4)

    Args:
        credits (str): The credits string.

    Returns:
        tuple: An ordered tuple of all possible credit values.
    """
    pass


def json_to_catalog(json_dict):
    """Convert from the json catalog format to the correct internal format.

    This will return an exact copy of the provided dictionary except for the
    following:

    * The lists of prerequisite course ids will be converted to sets.
    * The credit strings will be converted to integer tuples (using
    the parse_credits function)

    Args:
        json_dict (dict): A catalog dictionary as ready by the json module.

    Returns:
        dict: A catalog dictionary in the correct internal format.

    """
    pass


def load_catalog(filename):
    """Read course information from an JSON file and return a dictionary.

    Args:
        filename (str): The filename of the JSON file.

    Returns:
        dict: A dictionary containing course information.
    """
    pass


def get_dependencies(course_id, catalog):
    """Get the all dependencies for a course.

    This function will return the prerequisites for the course, plus
    all prerequisites for those prerequisites, and so on.

    Args:
        course_id (str): The ID of the course.
        catalog (dict): The dictionary containing course information.

    Returns:
        set: A set of course dependencies.

    """
    pass


def format_course_info(course_id, catalog, width=40):
    """Format course information for display.

    The resulting string will have five fields: Name, Description,
    Credits, Prerequisites, and Dependencies.  Each field will be
    separated by a blank line and each will be wrapped to the maximum
    allowable number of characters. The string will not end in a newline.

    Args:
        course_id (str): The ID of the course.
        catalog (dict): The dictionary containing course information.
        width (int, optional): The width for text wrapping. Defaults to 40.

    Returns:
        str: Formatted course information.

    """
    pass


def total_credits(schedule, catalog):
    """Calculate the range of total credits in a schedule.

    Args:
        schedule (list): The course schedule.
        catalog (dict): The dictionary containing course information.

    Returns:
        tuple: A two entry tuple where the first entry is the minimum
            total credits for the schedule and the second is the maximum total
            credits.
    """
    pass


def available_classes(schedule, semester, catalog):
    """Get the available classes for a semester based on the current schedule.

    A course is available for the indicated semester if it is not
    already present somewhere in the schedule, and all of the
    prerequisites have been fulfilled in some previous semester.

    Args:
        schedule (list): The current course schedule.
        semester (int): The semester for which to find available classes.
        catalog (dict): The dictionary containing course information.

    Returns:
        set: A set of available classes for the specified semester.

    """
    pass


def check_prerequisites(schedule, catalog):
    """Check for courses in a schedule with unmet prerequisites.

    Args:
        schedule (list): The course schedule.
        catalog (dict): The dictionary containing course information.

    Returns:
        set: A set of courses with unmet prerequisites.
    """
    pass
