Featured resource
2026 Tech Forecast
2026 Tech Forecast

1,500+ tech insiders, business leaders, and Pluralsight Authors share their predictions on what’s shifting fastest and how to stay ahead.

Download the forecast
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
Labs

JSON Inventory Reports in Python

Build a Python command-line restock reporter that reads nested inventory data from JSON, finds low-stock products, and produces both a console summary and a saved report. The lab focuses on drilling into dictionaries that contain lists of dictionaries, extracting nested values, and combining small helper functions into a complete workflow. By the end, you will be comfortable loading JSON, flattening nested data, filtering records, and formatting the results for users.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 22, 2026
Duration
40m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Explore the project and reporting goal

    Welcome to this lab! You are going to complete a small Python reporting utility that reads nested inventory data and turns it into useful reorder information for a store manager. info> This lab experience was developed by the Pluralsight team using an internally developed AI tool. All sections were verified by human experts for accuracy prior to publications. However, content may still contain errors or inaccuracies, and we recommend independent verification.

    To report a problem or provide feedback, click here. Feedback may be used to improve accuracy in accordance with our Privacy Policy.

  2. Challenge

    Load and traverse nested inventory data

    This step establishes the data-processing foundation for the rest of the lab. Before you can summarize or report anything, you need to read the inventory file into memory and understand how to move through its nested structure.

  3. Challenge

    Extract nested fields and build summaries

    This step moves from simple traversal into focused data extraction and summarization. Once you can identify the low-stock products, the next question is what information a manager actually needs in order to act.

  4. Challenge

    Assemble and export the report payload

    This step is where the application begins to feel complete. Up to now, each helper has produced one focused output: a filtered list, a list of emails, a totals dictionary, or a list of display lines.

  5. Challenge

    Present the results and wire the application flow

    The final step turns a collection of helpers into an actual command-line application. A useful script does more than compute a result silently; it usually presents a summary to the user and coordinates its own workflow from input to output. You've built all the pieces of the reporting workflow. Now it's time to run the application and see everything working together.

    Run the application from the Terminal tab:

    python3 -m restock_reporter.app
    

    Verify the console output:

    • Includes the warehouse name.
    • Includes the low-stock product count.
    • Includes a comma-separated list of supplier email addresses.
    • Includes an Items: section with a bullet for each low-stock product.

    Example output:

    Warehouse: Central Depot
    Low-stock products: 4
    Supplier emails: [email protected], [email protected], [email protected]
    Items:
    - APL-01 | Apples | qty 12 | reorder at 15
    ...
    

    Verify the report file:

    • The application creates:
      output/restock_report.json
      
    • The JSON file contains the following keys:
      • warehouse
      • low_stock_count
      • supplier_emails
      • items
      • section_totals

    Perform a final sanity check:

    • The warehouse name in the console matches the warehouse name in the JSON file.
    • The value of low_stock_count matches the number of entries in items.
    • The supplier email list contains no duplicates.
    • The section totals look reasonable based on the inventory data.

    If all of these checks pass, you've successfully completed the restock reporting workflow from end-to-end.

About the author

Pluralsight’s AI authoring technology is designed to accelerate the creation of hands-on, technical learning experiences. Serving as a first-pass content generator, it produces structured lab drafts aligned to learning objectives defined by Pluralsight’s Curriculum team. Each lab is then enhanced by our Content team, who configure the environments, refine instructions, and conduct rigorous technical and quality reviews. The result is a collaboration between artificial intelligence and human expertise, where AI supports scale and efficiency, and Pluralsight experts ensure accuracy, relevance, and instructional quality, helping learners build practical skills with confidence.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight