logo

Crowdly

Browser

Add to Chrome

Follow the link: https://classroom.github.com/a/1a2Fc0jK After the re...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

  1. Follow the link: https://classroom.github.com/a/1a2Fc0jK

  2. After the repository is created, clone it locally:

    git clone <your repository URL>

     

  3. Implement the following task in the university.py file:

          You are given two JSON files:

    • users.json — contains information about users in the following format:

                 [ { "id": 1, "name": "userName", "department_id": 1 }, ... ]

    • departments.json — contains information about departments in the following format:

      [ { "id": 1, "name": "departmentName" }, ... ]          

          Create appropriate JSON Schemas to validate the structure of users.json and  departments.json.

           Implement the functions:

  • user_with_department(csv_file, user_json, department_json):

                    This function should:

      • Read data from the provided JSON files.

      • Create a CSV file with the following format:

          header line - name, department

          next lines :  <userName>, <departmentName>

      • If a user refers to a department_id that doesn't exist in departments.json, raise a DepartmentName exception.

      • If the data does not match the schema, raise an InvalidInstanceError exception.

 

  • validate_json(data, schema):

which validates a JSON instance against a schema.

  1. Commit and push your solution to the GitHub repository.

More questions like this

Want instant access to all verified answers on softserve.academy?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome