SENN Bandgap Predictor
This repository packages a SENN perovskite bandgap model as:
- a Python package,
- a command-line tool,
- a FastAPI HTTP API,
- a Streamlit web app.
Input convention
The model input order is:
[MA, FA, Cs, Br, Cl, I]
Internally:
site_a = [MA, FA, Cs]site_x = [Br, Cl, I]
Local installation
cd senn_bandgap_deploy_template
pip install -e .
Python usage
from senn_bandgap import BandgapPredictor
predictor = BandgapPredictor()
y = predictor.predict([[0.0, 1.0, 0.0, 0.0, 0.0, 1.0]])
print(y[0])
CLI usage
senn-bandgap --MA 0 --FA 1 --Cs 0 --Br 0 --Cl 0 --I 1
Start FastAPI server
uvicorn api_fastapi:app --host 0.0.0.0 --port 8000
Open:
http://127.0.0.1:8000/docs
Example request:
curl -X POST "http://127.0.0.1:8000/predict" -H "Content-Type: application/json" -d '{"MA":0,"FA":1,"Cs":0,"Br":0,"Cl":0,"I":1}'
Start Streamlit app
streamlit run app_streamlit.py
Deployment options
Streamlit Community Cloud
Push this repository to GitHub, then select app_streamlit.py as the entrypoint.
Hugging Face Spaces
Create a Space and use Gradio or Streamlit as the SDK. For Streamlit, keep app_streamlit.py and requirements.txt.
Docker + FastAPI
docker build -t senn-bandgap .
docker run -p 8000:8000 senn-bandgap
Important note
If the original training used input normalization, target scaling, or composition preprocessing, you must reproduce exactly the same preprocessing during inference. Otherwise the API will run, but the predicted bandgap values may be numerically inconsistent with training.
Metadata
Release files for senn-bandgap 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| senn_bandgap-0.1.0.tar.gz | 48.6 kB | Without provenance | Details for senn_bandgap-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| senn_bandgap-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for senn_bandgap-0.1.0-py3-none-any.whl |
Total release size: 95.9 kB
Release files / senn_bandgap-0.1.0.tar.gz
| Download URL | senn_bandgap-0.1.0.tar.gz |
|---|---|
| Size | 48.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9981ebe79831515ec6bd2a91a59a78e1597859f81a65a0bda84ff262b35cf3ab
|
|
BLAKE2b-256 checksum How to use checksums |
eb7b1dcddb292e1a08529160783ffa03b7ee8754d4f49c7c96d9d17a15ea0e0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Release files / senn_bandgap-0.1.0-py3-none-any.whl
| Download URL | senn_bandgap-0.1.0-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fb39f780e59daa55da3a5ff640411cea76107826bedc7d85a16bf765cd266a3
|
|
BLAKE2b-256 checksum How to use checksums |
6ee18222568dffe5d9b0ed30f97cfae7adb8a36f6ea73af92427b548a37d3020
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Security for senn-bandgap 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.