File size: 356 Bytes
fb6ade0
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import streamlit as st
import polars as pl
import requests

GRIST_URL = "https://grist.numerique.gouv.fr/o/dim-chu-brest/api/docs/5ZXqTKBiHTD2qqUj6GVPtp"

@st.cache_data
def load_grist(table: str)->pl.DataFrame:
    records = requests.get(f"{GRIST_URL}/tables/{table}/records").json()["records"]
    return pl.DataFrame(records).drop("id").unnest("fields")