Web App Development Made Simple with Streamlit

Book description

Unlock the full potential of Streamlit, mastering web app development from setup to deployment with practical guidance, advanced techniques, and real-world examples

Key Features

  • Identify and overcome web development challenges, crafting dedicated application skeletons using Streamlit
  • Understand how Streamlit's widgets and components work to implement any kind of web app
  • Manage web application development and deployment with ease using the Streamlit Cloud service
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

This book is a comprehensive guide to the Streamlit open-source Python library and simplifying the process of creating web applications. Through hands-on guidance and realistic examples, you’ll progress from crafting simple to sophisticated web applications from scratch. This book covers everything from understanding Streamlit's central principles, modules, basic features, and widgets to advanced skills such as dealing with databases, hashes, sessions, and multipages.

Starting with fundamental concepts like operation systems virtualization, IDEs, development environments, widgets, scripting, and the anatomy of web apps, the initial chapters set the groundwork. You’ll then apply this knowledge to develop some real web apps, gradually advancing to more complex apps, incorporating features like natural language processing (NLP), computer vision, dashboards with interactive charts, file uploading, and much more. The book concludes by delving into the implementation of advanced skills and deployment techniques.

By the end of this book, you’ll have transformed into a proficient developer, equipped with advanced skills for handling databases, implementing secure login processes, managing session states, creating multipage applications, and seamlessly deploying them on the cloud.

What you will learn

  • Develop interactive web apps with Streamlit and deploy them seamlessly on the cloud
  • Acquire in-depth theoretical and practical expertise in using Streamlit for app development
  • Use themes and customization for visually appealing web apps tailored to specific needs
  • Implement advanced features including secure login, signup processes, file uploaders, and database connections
  • Build a catalog of scripts and routines to efficiently implement new web apps
  • Attain autonomy in adopting new Streamlit features rapidly and effectively

Who this book is for

This book is for Python programmers, web developers, computer science students, and IT enthusiasts with a foundation in Python (or any programming language) who have a passion for creating visually appealing applications. If you already know how to write programs, this book will help you evolve into an adept web application developer skilled at converting command-line tools into impressive, cloud-hosted applications.

Table of contents

  1. Web App Development Made Simple with Streamlit
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
    8. Download a free PDF copy of this book
  6. Part 1: Getting Started with Streamlit
  7. Chapter 1: Getting to Know Streamlit – A Brief Overview
    1. The importance of turning an idea into a prototype – the changing scenario in computing methods
    2. The importance of a full Python web framework
    3. Local versus the cloud
    4. Python libraries for web applications (Flask and Django)
    5. Examples of Streamlit’s capabilities
    6. The importance of turning an idea into a prototype
    7. Summary
  8. Chapter 2: Setting Up the Python Coding Environment
    1. Technical requirements
    2. Setting up the OS
    3. IDE selection
    4. What is a virtual environment?
    5. Summary
  9. Chapter 3: Exploring Streamlit’s Features and Functionality
    1. Technical requirements
    2. Installing and launching Streamlit
    3. Streamlit features and widgets
      1. Colored textboxes
      2. Images, audio, and video
      3. Inputting text and numbers
      4. Slider
      5. Balloons
    4. DataFrames, plots, and visualizations
    5. Date, time, and more
    6. Summary
  10. Part 2: Building a Basic Web App for Essential Streamlit Skills
  11. Chapter 4: Streamlit Essentials – Configuring the Environment, Managing Packages, and More
    1. Technical requirements
    2. Configuring our environment
    3. Installing and importing packages
    4. App skeleton building
    5. Building the menu and adding decorations
    6. Summary
  12. Chapter 5: Organizing and Displaying Content with Columns, Expanders, and NLP Techniques
    1. Technical requirements
    2. Organizing and arranging content in a web app
      1. Adding decorations
      2. Adding the Text Analysis part
    3. Hiding and showing parts depending on importance
      1. Adding columns, expanders, and a textbox
      2. Adding the two basic functions
      3. Adding a wordcloud
    4. Introducing NLP concepts – tokens and lemmas
      1. Adding the summarization function
      2. Tokens and lemmas
      3. Using the text_analysis function
    5. Summary
  13. Chapter 6: Implementing NLP Techniques for Text Analysis and Processing in Streamlit
    1. Technical requirements
    2. Deep-diving into NLP techniques
      1. What is translation?
      2. What is sentiment analysis?
    3. Deep-diving into language translation
      1. Adding a text area
      2. Performing the translation task
    4. Diving deep into sentiment analysis
    5. Recap of our first web application
    6. Summary
  14. Chapter 7: Sharing and Deploying Your Apps on the Cloud Using Streamlit Share
    1. Technical requirements
    2. Understanding the importance of deployment
      1. Best practices in web application deployment
      2. Additional benefits of web application deployment
      3. What are Streamlit Share and Streamlit Cloud?
    3. A quick introduction to GitHub
    4. Getting familiar with the Streamlit Share service
    5. Summary
  15. Part 3: Developing Advanced Skills with a Covid-19 Detection Tool
  16. Chapter 8: Advanced Environment Setup and Package Management for Building an AI-Powered Web App
    1. Technical requirements
    2. Configuring our environment
    3. Installing and importing packages
    4. Building the app skeleton
    5. Building the menu and adding decorations
    6. Summary
  17. Chapter 9: Optimizing Streamlit Web App UX with Customization and UI Features
    1. Technical requirements
    2. Dealing with more advanced web app features
    3. Adding the Image Enhancement section using the Pillow library
      1. Contrast
      2. Brightness
      3. Original
    4. Adding the Disclaimer and Info section
    5. Summary
  18. Chapter 10: Utilizing Pretrained Models to Create Specialized and Personalized Web Applications
    1. Technical requirements
    2. Understanding the benefits of pretrained ML models
    3. Creating customized web apps to improve user experience
    4. Utilizing predictions from ML
    5. Summary
  19. Chapter 11: Deploying and Managing Complex Libraries on Streamlit Share
    1. Technical requirements
    2. Consolidating cloud deployment skills
    3. Avoiding bad behavior
      1. Creating a list of all the packages that were installed and used to develop the Python code
      2. Creating a GitHub repository
      3. Avoiding runtime errors
    4. Managing difficult libraries
    5. Deploying the app on Streamlit Cloud
    6. Summary
  20. Part 4: Advanced Techniques for Secure and Customizable Web Applications
  21. Chapter 12: Smart File Uploading – Advanced Techniques for Professional Web Applications
    1. Technical requirements
    2. Understanding the customized features of the file uploader
      1. Creating a new virtual environment
      2. Building the app skeleton
      3. Creating a radio button for the app menu
    3. Creating a suitable file uploader for web apps
    4. Simplifying web apps with smart components
    5. Summary
  22. Chapter 13: Creating a Secure Login and Signup Process for Web Applications
    1. Technical requirements
    2. Understanding the logic behind the login and signup page
    3. What is SHA-256 and why should we use it?
    4. Connecting to a relational database and interacting with it
      1. Creating the Login menu
      2. Creating the Sign Up menu
      3. Running the app
      4. Adding a graphical user interface
    5. Retrieving or saving credentials from and to the database
    6. Summary
  23. Chapter 14: Customizing Pages, Personalizing Themes, and Implementing Multi-Pages
    1. Technical requirements
    2. Understanding new features related to deep customization
    3. Creating deeply customized pages
    4. Understanding theming and .toml files
    5. Exploring the multi-pages feature
      1. Creating multi-pages
      2. Passing a variable from one page to another
    6. Summary
  24. Chapter 15: Enhancing Web Apps with Forms, Session State, and Customizable Subdomains
    1. Technical requirements
    2. What are forms and when and why do we use them?
      1. The context manager approach
      2. The classic approach
    3. What is Session State and when do we use it?
    4. What are customizable subdomains and what possibilities do they offer?
    5. Summary
  25. Chapter 16: Takeaways and Conclusion
    1. How and when to use our web app working template
    2. How and when to use databases and advanced skills
    3. How to deploy web applications on the cloud
    4. Farewell!
  26. Index
    1. Why subscribe?
  27. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Rosario Moscato
    3. Download a free PDF copy of this book

Product information

  • Title: Web App Development Made Simple with Streamlit
  • Author(s): Rosario Moscato
  • Release date: February 2024
  • Publisher(s): Packt Publishing
  • ISBN: 9781835086315