src/schoology-extractor/data_generation/users.py
def load_users(request_client: RequestClient, users: List[Dict]) -> List[Dict]:
    """
    Load a list of users via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    users: List[Dict]
        A list of JSON-like user objects in a form suitable for submission to the
        Schoology user creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like user objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
    assert (
        len(users) > 0 and len(users) < 51
    ), "Number of users must be between 1 and 50"

    logger.info("Creating %s users via Schoology API", len(users))

    users_json = {"users": {"user": users}}
    post_response: List[Dict] = request_client.bulk_post("users", users_json)["user"]
    validate_multi_status(post_response)
    logger.info("Successfully created %s users", len(post_response))

    with_schoology_response_df: DataFrame = merge(
        json_normalize(users),
        json_normalize(post_response).drop("school_uid", axis=1),
        left_index=True,
        right_index=True,
    )

    return with_schoology_response_df.to_dict("records")

    Load a list of users via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    users: List[Dict]
        A list of JSON-like user objects in a form suitable for submission to the
        Schoology user creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like user objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    
Load a list of users via the Schoology API.
Parameters

request_client : RequestClient
A RequestClient initialized for access to the Schoology API
users: List[Dict]
A list of JSON-like user objects in a form suitable for submission to the
Schoology user creation endpoint.

Returns

List[Dict]
A list of JSON-like user objects incorporating the response values from the
Schoology API, e.g. resource ids and status from individual POSTing
Load a list of users via the Schoology API . Parameters request_client : RequestClient A RequestClient initialized for access to the Schoology API users : List [ Dict ] A list of JSON - like user objects in a form suitable for submission to the Schoology user creation endpoint . Returns List [ Dict ] A list of JSON - like user objects incorporating the response values from the Schoology API e . g . resource ids and status from individual POSTing
def load_users(request_client: RequestClient, users: List[Dict]) -> List[Dict]:
    assert (
        len(users) > 0 and len(users) < 51
    ), "Number of users must be between 1 and 50"
    logger.info("Creating %s users via Schoology API", len(users))
    users_json = {"users": {"user": users}}
    post_response: List[Dict] = request_client.bulk_post("users", users_json)["user"]
    validate_multi_status(post_response)
    logger.info("Successfully created %s users", len(post_response))
    with_schoology_response_df: DataFrame = merge(
        json_normalize(users),
        json_normalize(post_response).drop("school_uid", axis=1),
        left_index=True,
        right_index=True,
    )
    return with_schoology_response_df.to_dict("records")
def load_users ( request_client : RequestClient , users : List [ Dict ] ) -> List [ Dict ] : assert ( len ( users ) > 0 and len ( users ) < 51 ) , "Number of users must be between 1 and 50" logger . info ( "Creating %s users via Schoology API" , len ( users ) ) users_json = { "users" : { "user" : users } } post_response : List [ Dict ] = request_client . bulk_post ( "users" , users_json ) [ "user" ] validate_multi_status ( post_response ) logger . info ( "Successfully created %s users" , len ( post_response ) ) with_schoology_response_df : DataFrame = merge ( json_normalize ( users ) , json_normalize ( post_response ) . drop ( "school_uid" , axis = 1 ) , left_index = True , right_index = True , ) return with_schoology_response_df . to_dict ( "records" )
Load a list of users via the Schoology API.
Load a list of users via the Schoology API .
"""
    Load a list of users via the Schoology API.

    Parameters
    ----------
    request_client : RequestClient
        A RequestClient initialized for access to the Schoology API
    users: List[Dict]
        A list of JSON-like user objects in a form suitable for submission to the
        Schoology user creation endpoint.

    Returns
    -------
    List[Dict]
        A list of JSON-like user objects incorporating the response values from the
        Schoology API, e.g. resource ids and status from individual POSTing
    """
request_client
RequestClient
users
List[Dict]