Sublime Streamlit
A Sublime Text package for developing Streamlit apps.
Overview
Sublime Streamlit is a Sublime Text package I created to make the process of developing Streamlit apps easier. Streamlit is a Python framework used to make interactive data science and machine learning web applications.
Sublime Streamlit enhances the developer experience when working with the Streamlit library, providing completion snippets, a build system for running apps, and easy access to Streamlit docs.
Motivation
When creating Streamlit web apps inside Sublime Text, I noticed that Sublime Text does not natively support Streamlit development, and the existing plugin ecosystem did not provide that support either. Therefore, I decided to create a plugin for this specific purpose: making the development of Streamlit apps more seamless within Sublime Text.
Features
Sublime Streamlit contains 3 features: completion snippets, a build system, and documentation access.
Completion
Sublime Streamlit contains completion snippets for Streamlit commands. The full list of included completions can be found here.
Build System
The plugin comes with a build system, which uses streamlit run
to launch Streamlit apps.
Documentation
2 commands are available for exploring Streamlit docs through the Sublime Streamlit plugin.
When editing or viewing a Streamlit program, users can select a Streamlit command such as st.write
and run the Streamlit: Doc
command in the command palette to open the command’s Streamlit documentation page in a web browser.
Alternatively, the Streamlit: Search Doc
command in the command palette lets users search for Streamlit commands. Selecting the desired Streamlit command opens its documentation page in the browser.
How It Works
The documentation links are automatically collected using a Python script included in the repository’s helper
directory. The script scrapes the Streamlit documentation page, extracting links to available commands and saving related details to a JSON file that is then shipped with the plugin.
When users open Sublime Text and the Sublime Streamlit plugin is launched, the content of the JSON file is loaded. For both documentation commands, the command-link mapping in the JSON file is used to open relevant docs.
Demo
Learn More
The code for this plugin can be found here. Its Package Control listing is located here.
To learn more about my other Sublime Text plugins, visit this page.