A streamlit custom component for doubutsushogi (animal chess) game
Project description
streamlit-doubutsushogi
A streamlit custom component for interactive board of doubutsushogi (animal chess) game.
Install
# from pypi
pip3 install streamlit-doubutsushogi
# or from github
# see also the streamlit component API manual (https://docs.streamlit.io/library/components/components-api)
git clone https://github.com/kota7/streamlit-doubutsushogi.git
cd streamlit-doubutsushogi/streamlit_doubutsushogi/frontend
npm run build
pip3 install -U ../../
Usage
See the minimal example at example.py:
import streamlit as st
from streamlit_doubutsushogi import st_doubutsushogi
c1, c2 = st.columns([6, 6])
with c1:
state, status, action = st_doubutsushogi()
if status != 0:
c2.write(f"Game over! Won by the player {status}")
Run the script by:
streamlit run example.py
Doubutsu Shogi Master App
An interactive app is deployed on the Streamlit Cloud. To run the app on the computer locally, run the following:
streamlit run app/streamlit_app.py
Tips
How to upload this app to PyPI
# 1. build javascript sources
cd streamlit_doubutsushogi/frontend && npm run build && cd ../../
# 2. make python package wheel
rm -r build dist *.egg-info # only for the second time or later
python3 setup.py sdist bdist_wheel
# 3. upload to PyPI
twine upload --repository pypi dist/*
- Build the javascript application
- Make Python package wheel
- Upload to PyPI
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
streamlit-doubutsushogi-0.0.19.tar.gz
(717.3 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-doubutsushogi-0.0.19.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7204d813fe25932f88ecc4154260d9d76fbad681b4fd8c9ecbb102bf7621b16d |
|
MD5 | 21a2f13445e95bfca338bc9a6c469b23 |
|
BLAKE2b-256 | 435da97436065e0656134d0b1ee66743d8419a850a64c714b7b96777751a46d7 |
Close
Hashes for streamlit_doubutsushogi-0.0.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e639d8631787c4fa83eafb8c19c1a1b5d682a2212fa97b0b2ee5d2148916a685 |
|
MD5 | 3bc2afa0f2aaba4532fe1b9a7caac582 |
|
BLAKE2b-256 | 81c0a0e7ee27afa4137cd4f581623fadf17740fe9162411a07eb5ab36323c932 |