import marimo

__generated_with = "0.16.5"
app = marimo.App(width="medium")


@app.cell
def _():
    from pif_compiler.classes.models import Ingredient

    # Costruisce l'ingrediente da scraping e lo salva
    ing = Ingredient.ingredient_builder("64-17-5", inci=["ALCOHOL"])
    print(f"CAS: {ing.cas}")
    print(f"DAP: {ing.dap_info}")
    print(f"COSING: {ing.cosing_info is not None}")
    print(f"TOX: {ing.toxicity}")
    print(f"Stats: {ing.get_stats()}")

    # Salva su MongoDB + PostgreSQL
    mongo_id = ing.save()
    print(f"Salvato con mongo_id: {mongo_id}")
    return


if __name__ == "__main__":
    app.run()
