StreamJSME is a Streamlit component that use JSME to draw 2D molecules and use them on your Streamlit app
Project description
This package is intend to be used as Molecule Draw component on Streamlit applications. It use jsme-react. It was inspired on chemstreamlit_js; so, the credits all to them.
Build |
|
Source Code |
|
Python Versions |
|
Dependencies |
|
License |
|
Downloads |
Installation
pip install StreamJSME
Use
from StreamJSME import StreamJSME
from rdkit import Chem
from rdkit.Chem import Descriptors
from rdkit.Chem import Draw
from io import BytesIO
import streamlit as st
st.title('✍️ molecules with JSME in Streamlit 🤩')
# Create a first plot with an input SMILES, by default smiles = 'C'
update_smiles = StreamJSME(smiles='CCC')
st.subheader('Using the draw molecule inside RDKit')
st.write(f"New SMILES = {update_smiles}")
mol = Chem.MolFromSmiles(update_smiles)
st.write(f"MolLogP = {Descriptors.MolLogP(mol)}\n\nTPSA = {Descriptors.TPSA(mol)}")
st.subheader('Getting the RDKit image')
img = Draw.MolToImage(mol)
bio = BytesIO()
img.save(bio, format='png')
st.image(img)
To run the application
streamlit run --server.fileWatcherType none
Issues
If you have found a bug, please open an issue on the GitHub Issues.
Discussion
If you have questions on how to use StreamJSME, or if you want to give feedback or share ideas and new features, please head to the GitHub Discussions.
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
Built Distribution
File details
Details for the file StreamJSME-0.0.3.tar.gz
.
File metadata
- Download URL: StreamJSME-0.0.3.tar.gz
- Upload date:
- Size: 506.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2caf53cd097b5a944786fae42ea3478b33a18add31c10a1260b46406b98c8fbf |
|
MD5 | 3e1606ba6637040ef841520a4faab847 |
|
BLAKE2b-256 | 38b69cfa3e62ea6904b38661174eb5d6be2dad46ea425a7f3d073c192bddc6ed |
File details
Details for the file StreamJSME-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: StreamJSME-0.0.3-py3-none-any.whl
- Upload date:
- Size: 510.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1c41c45a24e8614425e3e28dfff1b657fcdf766eb33c50e014413332665e4f |
|
MD5 | 084a616593c6a49485a7458968fbad68 |
|
BLAKE2b-256 | 94f0159d4cf898c085bc9466647739fd9c6312a1f2115ffd36bdb8cb7b29da9d |