def get_filters(filepath):
"""Extract the filters from the file with description of filters in ENA as
a dictionary with the key being the filter id and the value a dictionary
with related results, type of filter, filter description
filepath: path with csv with filter description
"""
filters = {}
with open(filepath, "r") as f:
reader = csv.DictReader(f, delimiter=';')
for row in reader:
filter_id = row["Filter Column"]
filters.setdefault(filter_id, {})
filters[filter_id]["results"] = row["Result"].split(", ")
filters[filter_id]["type"] = row["Type"]
filters[filter_id]["description"] = ''.join(row["Description"])
return filters
serialize_ena_data_descriptors.py 文件源码
python
阅读 39
收藏 0
点赞 0
评论 0
评论列表
文章目录