Skip to main content

streamlit-custom-component

Streamlit component that allows you to build your own simple github copilot

Installation instructions

pip install streamlit-monaco-copilot

Usage instructions

type some code in the text area, and use shift + enter to run the component

import streamlit as st
from streamlit_monaco_copilot import st_monaco_copilot


from uuid import uuid4

value = st_monaco_copilot(
    "foo", 
    language='python',
    initial_code='print("hello world")',
    suggestion=st.session_state.get('suggestion', ''), 
    key='fixed'  # component need a key! or it will not be destoryed by streamlit rerun when suggestion changed!
)


value


if value and value.get('uuid'):
    new_uuid = value['uuid']
else:
    new_uuid = ''

if value and new_uuid and new_uuid != st.session_state.get('uuid'):
    # maybe use openai or deepseek api to get suggestion
    st.session_state['suggestion'] = 'i have suggestion about this code: `' + value.get('beforeCursor', '') + '`'
    st.session_state['uuid'] = new_uuid
    import time 
    time.sleep(1)  # i don't know why, but without this, the fontend component will not work
    st.rerun()

todo

  • remove toolkit near inline suggestion code

Metadata

Release files for streamlit-monaco-copilot 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-monaco-copilot 0.0.1
File Size Uploaded Provenance
streamlit_monaco_copilot-0.0.1.tar.gz 429.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-monaco-copilot 0.0.1
File Interpreter ABI Platform
streamlit_monaco_copilot-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 861.4 kB

Release files / streamlit_monaco_copilot-0.0.1.tar.gz

Download URL streamlit_monaco_copilot-0.0.1.tar.gz
Size 429.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c264be6e85513ed0a766ec4893ef5fb8e9f9e7a67ac79cef19c38505f00a918d
BLAKE2b-256 checksum
How to use checksums
2ea42b0108326ea5fed0d639cab48199333d215539d2a306edf88413c97932a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / streamlit_monaco_copilot-0.0.1-py3-none-any.whl

Download URL streamlit_monaco_copilot-0.0.1-py3-none-any.whl
Size 432.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1481cfcba01c284531c1dd3aa936f7f85486c5b86a51509808a8c3151c056c8
BLAKE2b-256 checksum
How to use checksums
84a71d83d2d4355bc663fb50af3146b6dcda0b38b24818960dc5ec45565232c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for streamlit-monaco-copilot 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page