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 1 month 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-06T15:26:36.000Z (about 1 year ago)
- Last Synced: 2025-04-06T16:28:55.497Z (about 1 year 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: 74.9 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- 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*
>
> |
| [](https://chatgpt.com/g/g-6780fa0b1180819198ea1d962dd4064c-sfppy)
๐ฅA custom AI assistant ๐ค extensively trained on **SFPPy** ๐๐ป. It helps you explore and use the framework: from the **principles of migration modeling** โ๏ธ to **first simulations** ๐, **regulatory compliance** โ
, **interpretation** ๐, and **reporting**๐. |
> | :----------------------------------------------------------: | :----------------------------------------------------------- |
### ๐ SFPPyLite
**No installation. Runs entirely in your browser. Try it nowโจ:**
> ๐ข Status update: **Production-ready** with full support for SFPPy notebooks
> โ
Complete support for simulation, plotting, curve fitting, and export to PDF/XLSX/CSV
> ๐ Integrated databases: EU Regulation Annex I, US FDA FCN lists, Chinese positive lists โ ~1300 substances included with toxicological assessment
> ๐ฆ Runs seamlessly in-browser โ no setup needed, fully compatible with modern tablets
> ๐๏ธ Files persist in your browser between sessions โ drag & drop your own files anytime
> ๐ Automatically stays up to date with the latest data and features
---
### ๐ What is SFPPy-Lite?
๐ **SFPPy-Lite** is a **lightweight (30 MB), 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.
>
> ๐ชง๐ ๐ช๐บ **Annex I of Regulation (EU) 10/2011**, ๐บ๐ธ **US FDA Food Contact Notification list** and ๐จ๐ณ **Appendices A1-A7 of Standard GB 9685-2016** are 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 | โ
Integrated and queryable |
| **US FDA FCN list (2025)** | โ
Integrated and queryable | โ
Integrated and queryable | โ
Integrated and queryable |
| **Appendices A1-A7 (Chinese standard GB GB 9685-2016)** | โ
Integrated and queryable | โ
Integrated and queryable | โ
Integrated and queryable |
| **PubChem substance retrieval** | โ
Fully functional | โ ๏ธ Partial (read-only, limited write support) | โ
Full access |
| **Toxicological assessment** | โ
Fully functional | โ ๏ธ Cramer class and alerts for shipped substances only | โ
Fully functional |
| **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 (Mac OS, IOS)
- โ โ Other Mobile browsers: not fully supported (to be tested case-by-case)
---
### ๐งฐ 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:olivier.vitrac@gmail.com) | ๐ค**With respect to regulatory compliance**, AI assists you by generating informed scenarios and interpretationsโbut **you remain the decision-maker**.
|