Data Apps With Advanced Python
Data Apps
Python Data Apps for Kids: Turn your ideas into fun and useful applications! Explore the world of data with Python and build your very own interactive apps.
Data Apps With Python Syllabus
Module 1: Introduction to Streamlit and Basic App
Getting started with Streamlit is a breeze! Install Streamlit, write your Python code, and see your app come to life with just a few lines. It’s that simple
What is Streamlit?
Streamlit is an open-source Python library that simplifies the process of creating web applications and data dashboards with minimal effort. It is designed for data scientists, engineers, and developers who want to build interactive and data-driven applications quickly and easily.
Key features of Streamlit include:
- Simplicity: Streamlit’s simplicity allows users to create web apps with just a few lines of Python code. It abstracts away much of the complexity of web development.
- Interactivity: Streamlit provides a variety of widgets like sliders, buttons, and text inputs that enable users to interact with data and customize the app’s behavior.
- Data Integration: Streamlit seamlessly integrates with popular data science libraries like Pandas, Matplotlib, and Plotly, making it easy to visualize and analyze data.
- Real-time Updates: Apps created with Streamlit update in real-time, so changes in data or inputs are reflected immediately in the app’s output.
- Customization: While Streamlit is beginner-friendly, it also offers customization options for more experienced developers who want to fine-tune the appearance and functionality of their apps.
- Wide Adoption: Streamlit has gained significant popularity in the data science and web development communities, with a growing ecosystem of extensions and resources.
Module 2: Age Calculator App
In this class, you will learn how to create the interface for your Age calculator interface
Streamlit Introduction: Understand the basics of Streamlit for creating web applications.
Streamlit Widgets: Learn to use Streamlit widgets such as st.title, st.text_input, and st.number_input for user interaction.
Taking User Input: Implement mechanisms to take user input, including the user’s name, year of birth, and current year.
User Interface Design: Design a simple and user-friendly interface using Streamlit’s layout capabilities.
In this class, you will learn how to use arithmetic operators to perform basic operations with the date of birth and the current year:
Data Processing: Perform basic data processing by subtracting the year of birth from the current year to calculate the user’s age.
Conditional Logic: Use conditional logic to ensure that the current year is within a valid range (2023 to 2050).
Displaying Results: Display the calculated age along with the user’s name in the app’s output.
In this class you will learn to use a button to view the result
Button Interaction: Implement a button to trigger the age calculation and display the result.
Output Formatting: Learn to format and display output messages dynamically.
Testing and Validation: Test the application with various inputs to ensure accurate age calculation and proper functionality.
Module 3: Daily Savings Calculator App
In this class, you will learn how to create a savings app to save
Streamlit Introduction: Understand the basics of Streamlit for creating web applications.
Streamlit Widgets: Learn to use Streamlit widgets such as st.title and st.number_input for user interaction.
Taking User Input: Implement mechanisms to take user input for daily savings for each day of the week.
User Interface Design: Design a simple and user-friendly interface using Streamlit for input and display.
In this class, you will learn how to create variables and store the saving values in them
Data Input: Prompt the user to enter daily savings for each day of the week.
Variable Usage: Create and use individual variables for each day to store daily savings.
Mathematical Calculation: Calculate the total savings for the week by summing up daily savings.
In this class, you will learn how to use arithmetic operators to program an age calculator in Python programming language
Displaying Results: Present the total savings for the week in a clear and user-friendly format.
Validation: Implement input validation to ensure that the user provides non-negative savings amounts.
Testing: Test the application with various inputs to verify that it calculates the total savings accurately.
Module 4: Chicken Order App
In this class, you will learn how to use a dropdown to create a chicken order app
Streamlit Basics: Understand the fundamentals of Streamlit for creating web applications.
User Interface Design: Learn to design a simple and interactive form using Streamlit widgets such as st.title, st.subheader, and st.selectbox.
Taking User Input: Implement mechanisms to take user input for chicken type and quantity using st.selectbox and st.number_input.
Form Validation: Ensure that the user cannot input negative quantities and set default values appropriately.
In this class, we will learn how to calculate the price of selected chickens
Data Processing: Store and manage data such as chicken types, prices per unit, and user input.
Calculations: Calculate the total cost of the chicken order based on the selected type and quantity.
Displaying Calculated Data: Use st.write to display the calculated total cost and order summary.
Order Summary Display: Learn how to present the order summary to the user in a clear and organized manner.
Testing and Validation: Test the application with various inputs to verify the accuracy of the total cost calculation and order summary display.
Customization: Customize the app’s appearance or add extra features, such as additional chicken types or discounts.
Module 5: Barber Service App
In this class, you will learn how to create the interface for the barber’s shop
Streamlit Introduction: Understand the basics of Streamlit for creating web applications.
User Interface Design: Learn to design an interactive interface using Streamlit widgets such as st.title, st.subheader, and st.multiselect.
Data Representation: Display service categories and fees in a clear and organized manner for user selection.
In this class, we will learn how to calculate cost of selected services based on user choices
Data Handling: Create a data structure (dictionary) to store service categories and their corresponding fees.
User Input Handling: Implement mechanisms to allow users to select multiple services from the available options using st.multiselect.
Mathematical Calculation: Calculate the total cost of selected services based on user choices and fee data.
Enhancing User Experience: Develop skills to enhance the user experience by providing clear and user-friendly output.
Displaying Results: Use st.write to display the selected services and their corresponding fees, as well as the total cost.
Testing and Validation: Test the application with various service selections to ensure accurate cost calculations and proper display.
Module 6: E-commerce Store and Fashion App
In this class, you will learn how to create the interface for the fashion’s shop
Streamlit Introduction: Understand the basics of Streamlit for creating web applications.
Menu-Driven Experience: Learn how to create a menu-driven shopping experience, allowing users to navigate between different product categories.
Product Organization: Explore methods to manage product categories and organize items for display within the store.
In this class, we will learn how to calculate cost of selected items based on user choices
Product Attributes: Understand how to present diverse fashion items with different attributes (e.g., clothing types, colors, sizes).
Price Display: Learn how to display pricing details for each product, including the ability to customize prices.
User Interaction: Implement features for users to select and customize their product choices.
Enhancing User Experience: Develop skills to enhance the user experience by providing clear and appealing visuals.
Shopping Cart: Implement a shopping cart or basket functionality to allow users to add and review their selected items.
Checkout Process: If applicable, design and implement a checkout process for users to complete their purchases.
Module 7: Restaurant Order and Splitting Bills
In this class, you will learn how to create the interface for the restaurant and order app
Streamlit Basics: Understand the basics of Streamlit for creating web applications.
User Interface Design: Learn to design an interactive user interface using Streamlit widgets like st.title, st.subheader, st.image, and st.checkbox.
Menu Presentation: Present food selections within different categories (Rice, Fruits, Drinks, Dessert, Ice Cream, Pizza) for user choice.
In this class, we will learn how to store food items, calculate cost of selected food items and enable users to share the bill with others
Data Organization: Create a data structure (dictionary) to store food items and their corresponding prices.
User Input Handling: Implement mechanisms to allow users to select food items using checkboxes and track their selections.
Mathematical Calculation: Calculate the total cost of selected food items and display it when requested.
Sharing Bills: Enable users to share the bill with others and calculate the cost per person.
Enhancing User Experience: Develop skills to enhance the user experience by providing clear and user-friendly output.
Displaying Results: Use st.write to display the selected food items, their corresponding prices, and the total bill.
Testing and Validation: Test the application with various food selections and bill-sharing options to ensure accurate calculations and proper display.
Module 8: File Handling and CSV Operations
In this class, you will learn how to create a Streamlit app for loading and presenting CSV data, including setting up the application, loading the data, and displaying it effectively.
File Handling Basics: Understand how to use Streamlit to create a simple web application.
CSV File Import: Learn how to load CSV files into a Pandas DataFrame using the pd.read_csv function.
Data Exploration: Explore the structure and content of the imported data.
Streamlit Title: Learn how to use the st.title function to set the title of a Streamlit app.
DataFrame Display: Explore methods for displaying data from a Pandas DataFrame within a Streamlit app.
Streamlit Application: Understand the basic structure of a Streamlit application, including how to initialize it.
File Path Handling: Learn how to specify the file path for reading the CSV file.
Data Validation: Implement data validation techniques to ensure that the imported data is in the expected format.
Module 9: Student Records Database
In this class, you will learn how to collect user input and implement calculations which will be used for a grading system
User Input: Learn how to collect user input, including the student’s name and scores in various subjects.
Data Calculation: Implement calculations to calculate the total score and average score based on the user’s input.
Grade Calculation: Create a grading system based on the calculated average score.
In this class, you will learn how to display data from a Pandas DataFrame
DataFrame Display: Learn how to display data from a Pandas DataFrame within a Streamlit app using st.dataframe.
User Feedback: Implement feedback mechanisms to inform the user of the calculated total score, average score, and assigned grade.
Interactive Elements: Explore interactive elements like buttons to allow users to trigger actions in the app.
In this class, you will learn how to read a CSV file, store and update the file
CSV File Handling: Understand how to read and write data to/from CSV files using Pandas.
Data Storage: Learn how to store and update student scores in a CSV file for future reference.
Data Validation: Implement validation mechanisms to ensure that user inputs are within expected ranges and formats.
Module 10: Employee Information System
In this class, you will learn how to collect employees input
Streamlit Form Creation: Learn how to create a form in a Streamlit app to collect user inputs for employee registration.
User Input Validation: Understand how to validate user inputs to ensure completeness.
Date Input: Explore the use of the st.date_input widget for collecting date-related information.
Dropdown Selection: Learn how to create dropdown menus for selecting options like education level, department, job title, and employee status.
In this class, you will learn how to display data from a Pandas DataFrame, reading and writing the data to CSV files
Pandas DataFrame: Understand how to work with Pandas DataFrames to store and manage employee data.
Data Concatenation: Learn how to add new employee data to an existing DataFrame using the pd.concat function.
CSV File Operations: Explore CSV file handling using Pandas, including reading and writing data to CSV files.
Data Persistence: Understand how to ensure that the data remains persistent between app sessions.
In this class, you will learn how to display all employee database in a tabular format and employee search functionality
Data Presentation: Learn how to display employee data in a tabular format within the Streamlit app using st.dataframe.
User Search: Implement a basic search functionality to find and display employee information based on employee ID.
Module 11: Streamlit Session State
In this class, you will learn Streamlit’s session state management and building interactive web applications that respond to user input.
Streamlit Basics: Introduce students to Streamlit and its use for building interactive web applications.
Button Widgets: Teach how to create button widgets in Streamlit for user interaction.
State Management: Explain the concept of state in Streamlit and how it’s used to store and manage data between interactions.
In this class, you will learn how to use session state in Streamlit for maintaining data across sessions.
Session State in Streamlit: Describe the importance of session state in Streamlit for maintaining data across sessions.
Storing Data: Explain how to store and retrieve data in session state using st.session_state.
Conditional Updates: Show how to conditionally update and display data based on user interactions, such as button clicks.
In this class, you will learn how to make apps interactive, update and display data in response to user interactions.
Interactive Elements: Demonstrate how to make apps interactive by responding to user actions, such as button clicks.
Stateful Apps: Explain how to create stateful apps where user inputs and actions persist across sessions.
Dynamic Updates: Teach how to dynamically update and display data in response to user interactions.
Module 12: Supermarket Shopping List
In this class, you will learn to create a Streamlit application that takes user input, stores it in a list, and displays the customer’s list interactively.
User Input Handling: Introduce students to handling user input in Streamlit applications.
Data Storage: Explain how to store data persistently using Streamlit’s session state.
In this class, you will learn how to manipulate and manage lists and use session state in Streamlit for maintaining data across sessions.
Interactive Elements: Teach how to create interactive elements like text input fields and buttons in Streamlit.
List Management: Demonstrate how to manipulate and manage lists in Streamlit, including appending and displaying list items.
In this class, you will learn how to format and present a list of items.
Displaying Data: Explain how to display data in Streamlit apps, including formatting and presenting a list of items.
Dynamic Updates: Teach how to dynamically update and display data based on user interactions.
Module 13: Guess the Number Game
In this class, you will learn to create an interactive number guessing game in Streamlit, where user input guesses and receive feedback on whether their guess matches the randomly generated number
Random Number Generation: Students will be introduced to generating random numbers in Python using the random module.
In this class, you will learn how to store user inputs and compare the input to the computer’s generated random number
User Input Handling: Students will learn how to use Streamlit to take user input and store it in the session state.
User Input Validation: Students will learn how to compare user input to a generated random number and provide feedback based on the comparison.
In this class, you will learn how to enter your guess and generate a new random number when the “restart” button
Game Interaction: Students will learn to create a simple number guessing game where users can input guesses and receive feedback.
Game Restart: Students will learn to reset the game by generating a new random number when the “restart” button is clicked.
Module 14: File Upload and Storage
In this class, you will learn file upload, image processing, user interface design, and library integration within a Streamlit application
File Upload Widget: Learn how to create a file upload widget in Streamlit.
File Type Validation: Learn the importance of validating file types when accepting user uploads.
Dropdown Menu: Learn how to use the st.sidebar.selectbox widget to create a dropdown menu for user navigation.
In this class, you will learn how to use the PIL library to open and display images
PIL (Python Imaging Library): Learn how use the PIL library and its role in processing images.
Image Opening: Learn how to use PIL to open and display images uploaded by users.
User Interface Design: Learn the importance of a well-organized user interface for a better user experience.
In this class, you will learn how to allow users to upload files in a web application
Library Integration: Learn how to integrate external libraries (PIL) into Streamlit apps to extend functionality.
User Guidance: Learn how to guide users through the app’s interface for a seamless experience.
Purpose of File Upload: Learn the purpose and advantages of allowing users to upload files in a web application.
Module 15: Receipt generator with PDF download
In this class, you will learn how to generate dynamic PDF invoices from user input and enable viewing and downloading within the Streamlit app.
Overview of Streamlit
Learn the basics of Streamlit, its features, and how to set up the development environment. Create a basic Streamlit application to understand its structure.
Streamlit Widgets and Layouts
Explore various Streamlit widgets for user input and learn how to organize the application layout using columns and containers.
Data Handling and Display in Streamlit
Understand how to load and display data from CSV files, create dynamic tables, and implement interactive elements for data updates.
Designing the Invoice Form
Design input fields for collecting invoice details such as customer information, item descriptions, quantities, and prices. Learn to calculate and display totals dynamically.
Validating and Storing User Input
Ensure data integrity through validation techniques, manage input data using lists and dataframes, and display the collected data in a structured format.
Enhancing User Interaction
Implement sidebar options for dynamic item number selection and display intermediate results to create a user-friendly and interactive interface.
Introduction to FPDF
Get an overview of the FPDF library, set up FPDF, and create a basic PDF document. Customize fonts, styles, and layouts for the PDF.
Creating the PDF Invoice Template
Design the layout of the invoice PDF, add dynamic content based on user input, and incorporate branding elements such as logos and headers.
Saving, Viewing, and Downloading PDFs in Streamlit
Integrate PDF generation with the Streamlit application, display the generated PDFs within the app, and implement functionality for users to download the invoices locally.
Module 16: Note Management Application
In this class, you will learn how to design and implement user input forms to collect and validate note data.
Overview of Streamlit: Learn the basics of Streamlit, its features, and how to set up the development environment. Create a basic Streamlit application to understand its structure.
Streamlit Widgets and Layouts: Explore various Streamlit widgets for user input and learn how to organize the application layout using columns and containers.
Data Handling and Display in Streamlit: Understand how to load and display data from CSV files, create dynamic tables, and implement interactive elements for data updates.
Designing the Note Form: Design input fields for collecting note details such as title, date, and content. Learn to manage and display the collected data dynamically.
Validating and Storing User Input: Ensure data integrity through validation techniques, manage input data using lists and dataframes, and display the collected data in a structured format.
Enhancing User Interaction: Implement sidebar options for dynamic selection and provide feedback to create a user-friendly and interactive interface.
Implement features to view and update notes, ensuring changes are saved properly.
Viewing Notes: Develop features to select and display specific notes from the stored data, allowing users to review their content and associated metadata.
Editing and Updating Notes: Create functionality to update the content of existing notes, ensure that edits are saved correctly, and provide user feedback on successful updates.