https://github.com/ovitrac/sfppylite
SFPPy running in a browser with Jupyterlite
https://github.com/ovitrac/sfppylite
chemicals compliance efsa fda food-contact food-packaging jupyterlite migration modeling-and-simulation plastics python recycled recycling regulation
Last synced: about 2 months ago
JSON representation
SFPPy running in a browser with Jupyterlite
- Host: GitHub
- URL: https://github.com/ovitrac/sfppylite
- Owner: ovitrac
- Created: 2025-03-20T21:32:38.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-27T22:06:05.000Z (about 2 months ago)
- Last Synced: 2025-03-27T23:20:27.833Z (about 2 months ago)
- Topics: chemicals, compliance, efsa, fda, food-contact, food-packaging, jupyterlite, migration, modeling-and-simulation, plastics, python, recycled, recycling, regulation
- Language: Jupyter Notebook
- Homepage: https://ovitrac.github.io/SFPPylite/
- Size: 61.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **๐ SFPPy-Lite ๐**
|  | This project is part of the
[Generative Simulation](https://github.com/ovitrac/generativeSimulation) demonstrators | Say it.
Simulate it with AI. |
| ---------------------------------------------- | ------------------------------------------------------------ | --------------------------------- |
---> ๐โฉ๐ **SFPPy**: A Python Framework for Food Contact Compliance & Risk Assessment
### ๐ SFPPyLite is Now Ready for Production!
**No installation. Runs entirely in your browser. Try it now:**
> ๐ข **Status update**: moved from ๐ง *Demo* to **Ready for Production**
> โ Full support for simulation, plotting, curve fitting, PDF/XLSX/CSV export
> ๐ EU Regulation Annex I included
> ๐ฆ Works directly in-browserโno installation required
> ๐ Always up to date with the latest sources---
### ๐ What is SFPPy-Lite?
๐ **SFPPy-Lite** is a **lightweight, browser-based preview** of the full SFPPy framework.
It is built on [**JupyterLite**](https://jupyterlite.readthedocs.io/), and runs Python entirely in the browser using [**Pyodide**](https://pyodide.org/) (WebAssembly-based).You can explore and use **SFPPyโs core functionalities** **instantly** โ with **no installation required** and **nothing to configure**.
Current performance is impressively close to that of a native desktop application.
---
### ๐โฉ๐ Access the Full SFPPy Framework
---
### ููููููููููููููู๏ฎฉูจูStatus: moved from ๐ง *Demo* to ๐ข *Ready for Production*
> [!WARNING]
> ๐ก **Start Here**: Launch the notebook `demo.ipynb` to begin (or watch the [video walkthrough](https://ovitrac.github.io/SFPPy/SFPPylite_demo.html)).
>
> โ All components are now operational, including notebooks under ๐**Notebooks/**, as well as **graphical interfaces**, **simulation**, **plotting**, **curve fitting**, and **export to PDF/XLSX**.
>
> โฑ๏ธ **SFPPyLite** runs at approximately half the speed ๐ of the desktop version. However, all notebooks execute in under one minute. This performance is sufficient for practical use, with the caveat that **native in-browser execution** (via Pyodide/WebAssembly) imposes some limitations.
>
> ๐ชง๐ The full ๐ช๐บ **Annex I of Regulation (EU) 10/2011** is included and searchable.
>
> ๐ฉ **PubChem substance retrieval** is *partially functional*: the module `private.pubchemspy` has been adapted for JupyterLite, but **write operations may fail** due to incompatibilities between **Pyodide** and **IndexedDB**, the browserโs internal filesystem.
>
> โ **ToxTree** is not supported, as it cannot currently be compiled to **WebAssembly**.
>
> ๐๏ธ Files (notebooks, scripts, datasets, etc.) are **persistently stored** in your browser across sessions. Your data remains safe unless using **private/incognito mode**. You can **drop files** into the interface or **download/export** any file as needed.
>
>---
### ๐ค๐ป๐ Comparison of `SFPPy` Across Platforms: Desktop, Lite, and Google Colab
๐งญ **Find the platform that fits best your requirements: ease, confidentiality, archiving, assistance**.
*All usage options are free of charge.*
| Feature / Capability | ๐ซ๐ป **SFPPy (Desktop)** | ๐ **SFPPyLite (Browser)** | โ๏ธ **SFPPy in Google Colab** |
| ----------------------------------------------------: | ------------------------------------------------- | -------------------------------------------------- | ---------------------------------------- |
| **AI-powered assistance (*e.g.* for interpretation)** | โ Not available or use **Jupyter Lab** extensions | โ Not available or use external extensions | โ Available (via Gemini) |
| **Installation required** | Yes (Python + dependencies) | โ No installation (runs in-browser) | โ No installation (via bootstrap script) |
| **Notebook execution speed** | Full native performance | โฑ๏ธ ~2ร slower (WebAssembly limits) | โ Fast (depends on Google backend) |
| **Simulation resolution / memory usage** | High (limited by system resources) | Reduced for complex models (browser memory limits) | High (usually) |
| **Graphical plotting (SVG, PNG, Retina)** | โ Full support | โ Full support | โ Full support |
| **Curve fitting and modeling tools** | โ Available | โ Available | โ Available |
| **Export formats (PDF, XLSX, CSV)** | โ Full support | โ Full support | โ Full support |
| **Annex I (Regulation (EU) 10/2011)** | โ Integrated and queryable | โ Integrated and queryable | โ Available (with correct files) |
| **PubChem substance retrieval** | โ Fully functional | โ ๏ธ Partial (read-only, limited write support) | โ Full access |
| **ToxTree integration** | โ Supported | โ Not supported (WebAssembly incompatible) | โ Supported |
| **Self-archiving and reporting (PDF + .ipynb)** | โ Automatic or manual | โ Not supported | โ Manual (download/export) |
| **Session persistence / multi-tab support** | Depends on setup | โ Fully supported (via IndexedDB) | โ Not persistent between sessions |
| **Offline usage** | โ Once installed | โ After initial load (cached in browser) | โ Requires internet |
| **Custom file upload/download** | โ OS-level | โ Browser-based (drag & drop or panel) | โ Upload/download via Colab UI |
| **๐ ๏ธ Updating Mechanism** | ๐ Manual updates via Git or package manager | ๐ Always updated to latest sources (on load) | ๐ Bootstrapped from latest version |---
### ๐ซ Requirements
๐**SFPPy-Lite** has been tested successfully on:
- โ Firefox 90+
- โ Chrome / Chromium 89+
- โ Safari Tech Preview (partial support)
- โ Mobile browsers: not fully supported yet---
### ๐งฐ Powered by
- [JupyterLite](https://jupyterlite.readthedocs.io/)
- [Pyodide](https://pyodide.org/)
- [SFPPy](https://github.com/ovitrac/SFPPy) โ Full Python framework---
### ๐ฌ Feedback?
๐ฌ Found a bug or have suggestions? [Open an issue](https://github.com/ovitrac/SFPPy/issues) or reach out via email โ feedback is welcome!
---
### ๐โฉ๐ `SFPPy`: Built for AI. Ready for Simulation.
๐ค +โ๏ธ *Can robots like **GPT** really evaluate food contact compliance using **SFPPy**?* *Check out the intriguing answers from two GPT-powered experts [here](https://github.com/ovitrac/SFPPy/wiki/๐ค-Ask-GPT-to-demonstrate-compliance-with-SFPPy)!*.
| [
](https://github.com/ovitrac/generativeSimulation)โ๐ปClick on the image to learn more. | ๐ฎ**Explore the future.** Coding is a languageโand with generative AI, we can bridge real-world problems to simulation-ready computer code. Python is the medium of choice, as it remains the most fluent language for AI systems.
โฐโโค***Prompts accelerate simulation prototyping** and the design of complex case scenarios. Thanks to the abstract nature of this interface, there are no constraints on the level of complexity: it operates independently of the underlying mathematical or numerical methods.*
|
| :----------------------------------------------------------- | :----------------------------------------------------------- |
| Credits: [Olivier Vitrac](mailto:[email protected]) | ๐ค**With respect to regulatory compliance**, AI assists you by generating informed scenarios and interpretationsโbut **you remain the decision-maker**.
|