This module provides a way to use a terminal under streamlit framework
Project description
streamlit_ttyd
streamlit_ttyd implements a terminal plugin for streamlit using the amazing ttyd project. As of now, only Linux like platforms are supported.
ttyd is MIT licenced which allows us to distribute the binaries as long as the associated licence is included. The ttyd licence is in ttyd_license file.
Please open an issue if you need support for windows or other platforms.
Installation
pip install git+https://github.com/NeveIsa/streamlit-ttyd
Usage
import streamlit as st
from streamlit_ttyd import terminal
import time
st.text("Terminal showing processes running on your system using the top command")
# start the ttyd server and display the terminal on streamlit
ttydprocess, port = terminal(cmd="top")
# info on ttyd port
st.text(f"ttyd server is running on port : {port}")
# kill the ttyd server after a minute
time.sleep(60)
ttydprocess.kill()
Demo
Arguments for terminal()
- cmd: str -> the command to run
- readonly: bool -> readonly terminal (default -> False)
- host: str -> protocol://hostname where streamlit server is run (default -> http://localhost)
- port: int -> port number to run the ttyd server on (default -> 0, automatically picked in the range 5000-7000)
- exit_on_disconnect -> whether to kill ttyd server when web-terminal is disconnected (default -> True)
- height: int -> height in pixels which is passed to streamlit.component.v1.iframe (default -> 500)
- ttyd (optional): user provided path to ttyd binary, if not provided, uses distributed binary
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_ttyd-0.2.0.tar.gz.
File metadata
- Download URL: streamlit_ttyd-0.2.0.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
851727d9ccb61b8e8671a69344c7101d82dcb1ee4787da676c5d9dca69b12028
|
|
| MD5 |
cc6f11493e1116dbac1b4dfb0e40a47e
|
|
| BLAKE2b-256 |
9304c8b9de1f4049d8beed26c01a26475dffac703a7b8cdd48ee0438e811baa1
|
File details
Details for the file streamlit_ttyd-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: streamlit_ttyd-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c442ed8c2b6f263029fb7a8d6e661f66bd4bb45fab8a3e30123988969df853b6
|
|
| MD5 |
618b602995044ae821672aa3ae2126a2
|
|
| BLAKE2b-256 |
8d594a18d8c87099f5918e14c17657971a483541d21cb700672c93efbe44b884
|