我有一个使用库pureconfig创建的 scala 配置文件。我想在 python 中编写一个包装器来读取和写入这个配置文件(以便更好地访问非 scala 用户)。是解析整个模式的最简单方法吗?
我的配置文件如下所示:
tables = [
{
name = TABLE_1
partition_strategy = "none"
partitions = [
{
path = [
"/shared/fall/raw/TABLE_1_2015.csv"
]
}
]
}
{
name = TABLE_2
partition_strategy = "none"
partitions = [
{
path = [
"/shared/fall/raw_data/TABLE_2_2015.csv"
]
}
]
}
{
name = TABLE_3
partition_strategy = "year"
partition_column = "FLX_DIS_DTD"
partitions = [
{
year = 2014
path = [
"/shared/fall/raw/2014_2016/PRODUCT/TABLE_3*2014.CSV",
"/shared/fall/raw/2014_2016/PRODUCT/TABLE_3*2015.CSV",
]
},
{
year = 2016
path = [
"/shared/fall/raw/2014_2016/PRODUCT/TABLE_3*2016.CSV",
"/shared/fall/raw/2014_2016/PRODUCT/TABLE_3*2017.CSV",
]
}
]
}
]