Skip to main content

StreamJSME is a Streamlit component that use JSME to draw 2D molecules and use them on your Streamlit app

Project description

This package is intended to be used as a Molecule Draw component on Streamlit applications. It uses jsme-react.

Build

pypi-version

Source Code

GitHub-Repo

Python Versions

pyversions

Dependencies

Streamlit JSME

License

license

Downloads

download

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)

If trying to run the Streamlit application you get OSError: [Errno 28] inotify watch limit reached, just use the flag --server.fileWatcherType none:

streamlit run app.py --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.

Acknowledgment

See the full list of contributors in the CONTRIBUTORS.md file.

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

streamjsme-0.1.1.tar.gz (100.9 kB view details)

Uploaded Source

Built Distribution

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

streamjsme-0.1.1-py3-none-any.whl (100.3 kB view details)

Uploaded Python 3

File details

Details for the file streamjsme-0.1.1.tar.gz.

File metadata

  • Download URL: streamjsme-0.1.1.tar.gz
  • Upload date:
  • Size: 100.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for streamjsme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f790747ebb5fb28b2119c0b9fb336eda94392ae475103f9a08c6e7c1ae05bccd
MD5 4528dea6e1d4b97dd239f12b85e4d028
BLAKE2b-256 9a035729a8b185c20f8c1457a2625d8ed5294e81ef5da2b641a38591af91f9c6

See more details on using hashes here.

File details

Details for the file streamjsme-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: streamjsme-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 100.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for streamjsme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22302cbc58d46cf703fed14b5094619f66c4fb8487c1d83b1b177bcb80817e16
MD5 4ef6e6078a6437b52f3fe9570ec322b4
BLAKE2b-256 fb3cc5de7c12947967503d42829e9c109b0ecac48ab69694fb4483abdea5e73c

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