2 Getting started with Streamlit

 

This chapter covers

  • Setting up your development environment
  • The Streamlit development workflow
  • Building and running your first Streamlit app

Welcome to chapter 2. This is where the rubber hits the road! By the end of this chapter, you'll be interacting with your first very own Streamlit app!

This book is not just about teaching you Streamlit. It's also about making sure you're productive with Streamlit and well-positioned to develop real-world apps. Before we jump into writing code, let’s take some time to set up your development environment. Specifically, we'll discuss three key considerations for your workflow: version control with Git, code editing tools, and virtual environments.

We'll then examine the workflow you'll follow while coding with Streamlit so you know what to expect as you build apps throughout this book. With that out of the way, I'll walk you through the step-by-step process of creating your first app, a password checker.

Excited yet? Let's dive in!

Note

The GitHub repo for this book is https://github.com/aneevdavis/streamlit-in-action. The chapter_02 folder contains the code for this chapter.

2.1 Getting Streamlit up and running

First things first! Before building any apps, you need Streamlit installed and ready to go. This involves two steps:

2.2 Setting up your development environment

2.2.1 Version control with Git

2.2.2 Code editors

2.2.3 Virtual environments

2.3 Running Streamlit for the first time

2.4 The Streamlit development workflow

2.5 Building your first app

2.5.1 A password checker

2.5.2 Logic flow

2.5.3 Going through the code

2.5.4 Running the app

2.5.5 Making changes to the app

2.5.6 Killing and restarting the server

2.6 Summary