All gists matching topic configuration-management

timmy / YAML 檔案讀寫與資料管理

1 喜歡
0 分支
1 檔案
最後活躍 10 months ago
這段程式碼提供了一個 YAMLProcessor 類別,負責讀取和寫入 YAML 檔案(預設為 local_data.yaml),並將其內容轉換為 pandas.DataFrame 進行處理,適用於需要以表格形式操作 YAML 資料的應用場景。
1 import os
2 import yaml
3 import pandas as pd
4 import logging
5 from typing import Any, Dict, List
6
7 # 設定 logging 基本參數
8 logging.basicConfig(level=logging.INFO)
9 logger = logging.getLogger(__name__)

timmy / 使用 Streamlit 建立 YAML 編輯器

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
此程式使用 Streamlit 讓使用者讀取、編輯並儲存 YAML 文件,透過 pandas 轉換為表格格式,適用於設定檔管理與資料編輯工具。
1 from io import StringIO
2
3 import pandas as pd
4 import streamlit as st
5 import yaml
6
7
8 # 定義 YamlHandler 類
9 class YamlHandler:
10 def __init__(self, file_path):
上一頁 下一頁