top of page

💻 Streamlit for Geoscientists: Rapid Prototyping with a Few Things to Know

  • Laurent
  • Mar 17
  • 2 min read

Updated: May 20

In the fast-changing world of geoscience, more and more professionals are turning to Python to speed up workflows — from data cleaning to statistical modeling. And when it comes to quickly turning a script into something interactive and shareable, Streamlit is often the first tool that comes up.


But while Streamlit is a fantastic gateway into building tools, it has a few limitations you should know before going too deep. Let’s walk through what it is, why geologists love it, and what “stateless” really means — in plain language.


🚀 What Makes Streamlit So Popular?


Streamlit is a Python library that allows you to create web apps with just a few lines of code. No need to learn JavaScript, HTML, or complicated frameworks.

For geologists, that means you can:

  • Turn a notebook or script into a shareable app.

  • Build tools for automating repetitive Excel tasks.

  • Visualize drillhole or core data interactively.

  • Prototype data science workflows or estimation models.


👇 Here’s a basic example:


streamlit for geologist assay
Display the first lines of your assay file in streamlit


Paste that into a .py file, run streamlit run yourfile.py, and you’ve got a mini app. It’s that simple.


⚠️ But Let’s Talk About Statelessness


Here’s where we hit one of Streamlit’s core limitations: it’s stateless.


🧠 What does “stateless” mean?


Imagine your app is like a whiteboard. Each time a user clicks a button or uploads something, Streamlit wipes the board and redraws it — from top to bottom.


This means:

  • The app doesn’t remember any user actions by default.

  • You can’t track different users without extra effort.

  • You need to save data externally (e.g., to a file or database) if you want to “remember” it between sessions.


For example, if someone uploads a file, that file won’t stay in memory unless you process and save it. If the page reloads, the upload is gone.


🛠️ So When Should You Use Streamlit?


Streamlit is perfect for:

  • Internal tools used by you or your team.

  • Rapid prototyping of a concept or tool.

  • Quick data visualizations or dashboards.

  • Automating basic, repetitive tasks.

But it may not be ideal for:

  • Multi-user web apps with login systems.

  • Workflows that require saving state across users/sessions.

  • Heavy-duty production applications.


📌 Final Thoughts


Streamlit has lowered the barrier for geoscientists and technical teams to turn scripts into something usable and visual. And in a world where Excel, VBA macros, or manual work can slow down decision-making, tools like this are a huge step forward.

Just remember — Streamlit is great for getting started, but if you find yourself trying to “hack around” it too much, it might be time to look at other options like Dash, Flask, or even full-stack tools.


TL;DR: Streamlit is a lightweight, Python-based web app tool that geoscientists can use to build quick, useful tools. Just keep in mind its stateless design and use it for what it does best: simple, interactive, fast prototypes.



Comments


bottom of page