Skip to main content

How to Import the Streamlit Module into Your Streamlit Application

Updated 1 min readMarkdown
How to Import the Streamlit Module into Your Streamlit Application

When building a Streamlit app, the first step is to import the Streamlit module into your app.py file. The app.py file contains the Python code that defines your Streamlit application.

To import Streamlit, add the following statement at the beginning of your app.py file:

import streamlit as st

This statement imports the streamlit module and assigns it the alias st, allowing you to access Streamlit's functionality using a shorter name.

An alias is an alternative name used to refer to a module in your code. In Python, the as keyword allows you to assign an alias to an imported module.

For example, instead of writing streamlit every time you use its functionality, you can simply use st.


This mini-guide was originally published on PDF Python Hub, where you can find more in-depth Python resources for working with PDFs.


Want to learn how to create an app.py file?

Check out this mini-guide: Build and Deploy a “Hello World” Web App with Streamlit Community Cloud + GitHub.


This mini-guide was originally published on PDF Python Hub, where you can find more in-depth Python resources for working with PDFs.

About the author

  • PDF Python Hub is dedicated to teaching PDF programming, automation, and engineering with Python through practical, project-based courses. Whether you're a complete beginner or an experienced Python developer, the goal is to help you build the skills needed to work with PDF documents confidently—from reading and extracting data to building enterprise document processing and AI-powered workflows. What You'll Learn The curriculum covers every stage of PDF processing, including: -PDF fundamentals -Document extraction -PDF manipulation -Forms, tables, and images -OCR and scanned documents -Security and redaction -Enterprise automation -AI-powered document processing How You'll Learn Every course is designed to be: -Beginner-friendly with clear, step-by-step explanations -Focused on practical, real-world applications -Built around hands-on projects and assessments -Structured as a complete learning path from beginner to expert Our Mission Our mission is simple: To make PDF processing with Python accessible, practical, and enjoyable by teaching real skills that can be applied to everyday automation tasks and professional software development. Whether you're learning for your career, your business, or your own projects, you'll gain the knowledge and confidence to build powerful PDF automation solutions with Python. Learn more: https://payhip.com/PDFPythonHub/blog/news

No comments yet. Be the first to comment.