Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/randyzwitch/streamlit-embedcode
Streamlit component for embedding code snippets such as GitHub gists, CodePen snippets, Gitlab snippets, etc.
https://github.com/randyzwitch/streamlit-embedcode
data-analysis data-science data-visualization python streamlit streamlit-component
Last synced: about 1 month ago
JSON representation
Streamlit component for embedding code snippets such as GitHub gists, CodePen snippets, Gitlab snippets, etc.
- Host: GitHub
- URL: https://github.com/randyzwitch/streamlit-embedcode
- Owner: randyzwitch
- License: mit
- Created: 2020-06-30T16:21:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-17T19:02:53.000Z (over 3 years ago)
- Last Synced: 2024-09-28T13:41:08.867Z (about 2 months ago)
- Topics: data-analysis, data-science, data-visualization, python, streamlit, streamlit-component
- Language: Python
- Homepage: https://share.streamlit.io/randyzwitch/streamlit-embedcode/examples/streamlit_app.py
- Size: 180 KB
- Stars: 58
- Watchers: 3
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-embedcode
![Python package](https://github.com/randyzwitch/streamlit-embedcode/workflows/Python%20package/badge.svg)
[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/randyzwitch/streamlit-embedcode/examples/streamlit_app.py)
streamlit-embedcode is the easiest way to embed code snippets into your Streamlit app! This [static component](https://docs.streamlit.io/en/stable/develop_streamlit_components.html#create-a-static-component) supports the following code sharing services:
- [GitHub gist](https://gist.github.com/)
- [GitLab snippets](https://gitlab.com/explore/snippets)
- [Pastebin](https://pastebin.com/)
- [CodePen](https://codepen.io/)
- [Ideone](https://ideone.com/)
- [TagMyCode](https://tagmycode.com/)## Installation
streamlit-embedcode is distributed via [PyPI](https://pypi.org/project/streamlit-embedcode/):
```python
pip install streamlit-embedcode
```## Examples
Using streamlit-embedcode is as simple as importing the code service you want to use:
```python
import streamlit as st
from streamlit_embedcode import github_gistgithub_gist("https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087/")
```Optionally, you can provide arguments for `height`, `width` and `scrolling` to control the behavior of the iframe the content is displayed in.
![github_streamlit_embed](https://github.com/randyzwitch/streamlit-embedcode/blob/master/_static/gh_gist_example.png)