File size: 448 Bytes
d064c89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import json
from pathlib import Path

import streamlit as st


def load_json(file_path: Path) -> dict | list:
    with open(file_path, "r") as f:
        return json.load(f)


def save_json(file_path: Path, data: dict | list) -> None:
    with open(file_path, "w") as f:
        json.dump(data, f, indent=4)


def load_css(file_name) -> None:
    with open(file_name) as f:
        st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)