Skip to main content

Streamlit component that allows you to play piano

Project description

Streamlit Pianoroll

Streamlit component that allows you to play MIDI.

Installation instructions

pip install streamlit-pianoroll

Usage instructions

import streamlit as st

from pianoroll_streamlit import pianoroll

st.write("This is a pianoroll!")

pianoroll()

Development instructions

  • Initialize and run the component template frontend:
$ cd pianoroll_streamlit/frontend
$ npm install    # Install npm dependencies
$ npm run start  # Start the Webpack dev server
  • From a separate terminal, run the template's Streamlit app:
$ cd template
$ . venv/bin/activate  # activate the venv you created earlier
$ pip install -e . # install template as editable package
$ streamlit run streamlit_pianoroll/example.py  # run the example
  • If all goes well, you should see something like this:
image

Code Style

This repository uses pre-commit hooks with forced python formatting (black, flake8, and isort):

pip install pre-commit
pre-commit install

Whenever you execute git commit the files altered / added within the commit will be checked and corrected. black and isort can modify files locally - if that happens you have to git add them again. You might also be prompted to introduce some fixes manually.

To run the hooks against all files without running git commit:

pre-commit run --all-files

Publishing

Tutorial

# Prepare JS
cd streamlit_pianoroll/frontend
npm run build
cd ../..

# Releasey PYPI
echo "Update version in setup.py, pls"
python setup.py sdist bdist_wheel
python -m twine upload --repository pypi dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-pianoroll-0.7.4.tar.gz (321.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_pianoroll-0.7.4-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file streamlit-pianoroll-0.7.4.tar.gz.

File metadata

  • Download URL: streamlit-pianoroll-0.7.4.tar.gz
  • Upload date:
  • Size: 321.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for streamlit-pianoroll-0.7.4.tar.gz
Algorithm Hash digest
SHA256 074769aca7734f727e8dc6800e08ba9e648c0d4e5af10c5f928a7390d2c70b42
MD5 b9fc04324aa6c397f1dd119f62cd8d69
BLAKE2b-256 991a73c337f1a56dd1b6186920ebf061ef6e3d95295518943dc6f2fe9deabb9c

See more details on using hashes here.

File details

Details for the file streamlit_pianoroll-0.7.4-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_pianoroll-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1e3320de9a83b675340b955a9e235552af96b6e263a9e6f2f04513390ac445
MD5 887fe00b108545cb94e6abdf70d4ea1a
BLAKE2b-256 0985ee1ee5be18e9ea471d988a0b6a0d36f735cf5b225012e2a506ccfbff6f22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page