src/canvas-extractor/tests/data_generation/courses.py
def generate_courses(record_count: int) -> List[Dict]:
    """
    Generate a list of Canvas courses.

    Parameters
    ----------
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course create endpoint.
    """
    assert record_count > 0, "Number of courses to generate must be greater than zero"

    logging.info(f"Generating {record_count} courses")
    courses = []
    for i in range(1, record_count + 1):
        if i % 1000 == 0:
            logging.info(f"{i} courses...")
        courses.append(
            {
                "course[name]": fake.catch_phrase(),
                "course[course_code]": fake.bothify("?#######"),
                "offer": "true",
            }
        )
    return courses

    Generate a list of Canvas courses.

    Parameters
    ----------
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course create endpoint.
    
Generate a list of Canvas courses.
Parameters

record_count : int
The number of courses to generate.

Returns

List[Dict]
A list of JSON-like course objects in a form suitable for submission to the
Canvas course create endpoint.
Generate a list of Canvas courses . Parameters record_count : int The number of courses to generate . Returns List [ Dict ] A list of JSON - like course objects in a form suitable for submission to the Canvas course create endpoint .
def generate_courses(record_count: int) -> List[Dict]:
    assert record_count > 0, "Number of courses to generate must be greater than zero"
    logging.info(f"Generating {record_count} courses")
    courses = []
    for i in range(1, record_count + 1):
        if i % 1000 == 0:
            logging.info(f"{i} courses...")
        courses.append(
            {
                "course[name]": fake.catch_phrase(),
                "course[course_code]": fake.bothify("?#######"),
                "offer": "true",
            }
        )
    return courses
def generate_courses ( record_count : int ) -> List [ Dict ] : assert record_count > 0 , "Number of courses to generate must be greater than zero" logging . info ( f"Generating {record_count} courses" ) courses = [ ] for i in range ( 1 , record_count + 1 ) : if i % 1000 == 0 : logging . info ( f"{i} courses..." ) courses . append ( { "course[name]" : fake . catch_phrase ( ) , "course[course_code]" : fake . bothify ( "?#######" ) , "offer" : "true" , } ) return courses
Generate a list of Canvas courses.
Generate a list of Canvas courses .
"""
    Generate a list of Canvas courses.

    Parameters
    ----------
    record_count : int
        The number of courses to generate.

    Returns
    -------
    List[Dict]
        A list of JSON-like course objects in a form suitable for submission to the
        Canvas course create endpoint.
    """
record_count
int