Video summary

BISDI FEB UNPAD - Pemrograman Komputer 2 - B - #10 - 27 Oct 2026

Main summary

Key takeaways

Educational

Summary

The lecture introduces three connected areas of Python programming—APIs and JSON, graphical user interfaces (GUIs), and object-oriented programming (OOP)—and shows how they can be combined in practical applications.

1. When to Use Libraries and APIs

  • For straightforward local tasks—such as loops, functions, and basic calculations—an API is usually unnecessary.
  • A library provides ready-made functionality for particular tasks. Examples include:
    • NumPy and SciPy for numerical or scientific work
    • pandas for working with data
    • Matplotlib for charts
    • Python’s datetime module for dates and times
  • An API (Application Programming Interface) is an agreed method for one application to request or exchange information with another. For example, a Python program might request current weather, sensor readings, or currency-conversion data from an external service.
  • HTTP is commonly used to make API requests. A service may impose usage limits, require payment, or restrict access.

2. JSON and Data Processing

  • JSON (JavaScript Object Notation) is a lightweight text format commonly used to exchange data between applications.
  • JSON often represents data as key–value pairs, with nested objects and lists. Python can load and parse JSON using its built-in json functionality.
  • JSON and APIs are related but not identical: a program can process JSON that is already available locally, while an API is needed when the program must request data from another service.
  • The instructor demonstrates requesting dummy data from JSONPlaceholder, checking for a successful response (such as HTTP status 200), and reading fields from the returned JSON.
  • A currency-conversion example uses the Frankfurter API to retrieve an exchange rate rather than relying on a manually entered rate that may be out of date.

3. API Access, Web Crawling, and Security

The instructor contrasts using an official API with web crawling:

  • APIs provide data through a defined interface and may be easier to process, but access can be restricted or paid.
  • Crawling reads information from web pages. It may avoid API access requirements, but the data can be messy, harder to parse, and subject to technical or access limitations.

A past social-media sentiment-analysis project illustrates collecting posts and extracting text or hashtags. Crawled page data may need substantial cleanup and parsing before it can be analyzed.

API credentials and access tokens must be protected. If a credential is exposed—for example, by being placed in a public repository or shared carelessly—someone else may be able to use the associated account or service. The instructor compares an API credential to an access card that could be misused if copied or stolen.

4. GUIs and Interface Design

A GUI lets users interact with a program through visual elements such as buttons, text fields, sliders, drop-down menus, and radio buttons.

Unlike a basic command-line program, a GUI can respond immediately to user actions—for example, recalculating a discount when a slider changes. The instructor shows examples of product and sales interfaces, including one generated or improved with AI and a manually written Tkinter-style example.

A useful design process is:

  1. Decide which interface components the application needs.
  2. Determine what each component does.
  3. Place components inside appropriate frames or containers, which may be nested.
  4. Connect user actions, such as clicking a button, to functions that perform the relevant work.

The visual appearance matters, but the interface also needs a clear structure and working behavior.

5. OOP: Choosing Classes and Organizing Responsibilities

OOP organizes code around classes and objects. A class acts as a blueprint, and its constructor initializes an object’s data.

The lecture revisits:

  • Accessors, which retrieve information
  • Mutators, which change values
  • Encapsulation, which controls how data is accessed or changed
  • Inheritance, where a class can extend another class

Python does not enforce access modifiers in the same way as some languages. A leading underscore conventionally signals that an attribute is intended for internal use.

There is no single correct class design for a problem. The important task is to identify the entities and responsibilities in the system. A simple task may not benefit from OOP, while a system with many roles, interactions, and rules may.

For example, a sales application might involve products, customers, sellers, suppliers, inventory, transactions, and different payment methods. These could be represented by separate classes depending on the system’s requirements.

A more involved example separates responsibilities among product, API-client, catalog, discount, order, and analytics classes. Different discount policies can be represented through inheritance.

6. Combining APIs, GUIs, Libraries, and OOP

The lecture’s larger example is a product or e-commerce dashboard that:

  • Retrieves products from a Fake Store API using Python’s requests library.
  • Parses the returned JSON and displays product information.
  • Lets users search for or select products, add items to an order, and apply discounts.
  • Uses data-analysis or plotting libraries to summarize products, categories, or sales.
  • Uses GUI widgets to present results and accept user input.
  • Uses OOP to divide the work among classes with distinct responsibilities.

The instructor emphasizes handling failures when requesting external data. A server may be unavailable, a URL may be incorrect, or a request may time out. Using try/except-style error handling allows the program to report failures rather than simply stopping unexpectedly.

7. AI as a Tool, Not a Replacement for Understanding

The instructor demonstrates using AI tools to draft or reorganize code and create GUI examples. AI can be useful, but it may produce errors or awkward designs, so students need enough programming knowledge to inspect, test, and correct its output.

The instructor’s central principle is to retain the ability to build a basic solution without AI, then use AI to improve or accelerate it. AI policies for coursework may differ, and any permitted use should follow the course rules.

Programming can also be applied to practical business problems. Students are encouraged to notice recurring needs or frustrations and consider whether an application or analysis tool could address them.

8. Problem-Solving Approach and Course Plans

The instructor recommends starting with the problem rather than immediately writing code:

  1. Define the problem and the outcome the application should provide.
  2. Break the problem into smaller tasks and identify the interactions involved.
  3. Identify the data, actors, and processes the system needs.
  4. Decide how responsibilities should be organized, including whether OOP is appropriate.
  5. Implement and test the pieces, including API requests, interface behavior, and error handling.

When reading larger code examples, students are encouraged to inspect them by section or responsibility, rather than trying to understand every line at once.

The class has just completed midterms. The next topic is databases, followed by further project work and review. The instructor says assignments will be posted through Google Classroom, encourages students to submit work regularly rather than letting it accumulate, and allows resubmissions for students who want to improve an earlier submission.

Speakers and Sources Featured

  • Speaker: The course instructor, who leads the lecture and demonstrations.
  • Other speakers: Students appear to respond briefly or are addressed by name, but the subtitles do not establish additional sustained speakers.
  • Programming tools, libraries, and services mentioned or demonstrated: Python, HTTP, JSON, requests, json, NumPy, SciPy, pandas, Matplotlib, datetime, Tkinter and GUI widgets, Google Colab, Google Classroom, JSONPlaceholder, Frankfurter API, Fake Store API, Instagram, and X/Twitter.
  • AI tools mentioned: ChatGPT/GPT, Gemini, and Claude.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video