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
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.7.tar.gz
(715.5 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-doubutsushogi-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc019a8b3f29aef9d29073f2b04de95de4cd667f04d84f7d55e2cc8f9b5d4ca2 |
|
MD5 | 9295ca223cb46673f77f05f3f6131b95 |
|
BLAKE2b-256 | eaa7e88cb7ca81f0058d00b34847444d9a469fa1e2142fbc9c34baa1dfaf9ab5 |
Close
Hashes for streamlit_doubutsushogi-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b3e87cb20af11b3330d8d3fd9e65cb73882eefd40cd0a21d6a8250531bf440b |
|
MD5 | e0df7cba64d2873e26421c1d3e653df3 |
|
BLAKE2b-256 | 16b857a32ef3828cfefee0c045e1aa7cc6a40f3a9defeb82b0763e484562e6d1 |