XMLtoJSON
1.0.0
该项目提供了一组脚本和工具,用于将XML文件转换为JSON格式。它旨在与不同的XML数据源一起使用,并且可以完全自定义,从而支持多个转换模块。该项目分为单独的Python模块,用于处理不同类型的数据,包括文档,人员和档案。
解决方案包括:
convert/
archiveLinkConvert.py # Handles conversion of archive link XMLs
artworkConvert.py # Handles artwork XML data
commonConvert.py # Contains common conversion utilities
personConvert.py # Handles conversion of person-related XMLs
docs/
pictures/ # Picture documentation related to the project
Analyza_SP.md # Analysis related documentation
documentaria_rudolphina.md # Project-specific documentation
model/
ArchiveLink.py # Data model for archive links
Document.py # Data model for documents
Person.py # Data model for person records
scripts/
main_convert.py # Main script to execute conversion
.gitignore # Git ignore configuration
README.md # This documentation file 要使用此工具,您需要安装Python和PIP。
然后,运行以下命令:
pip install -r requirements.txt这将安装必要的库来运行脚本。然后,只需使用适当的选项运行main_convert.py脚本。这是从XMLtoJSON目录运行程序的主要命令:
显示帮助信息:
python3 scripts/main_convert.py --help或者
python3 scripts/main_convert.py --h转换所有类型的XML文件:
python3 scripts/main_convert.py --type all --input_path " path_for_input_data " --output_path " path_for_output_data "转换与名称相关的XML文件:
python3 scripts/main_convert.py --type names --input_path " path_for_input_data " --output_path " path_for_output_data "转换与寄存器相关的XML文件:
python3 scripts/main_convert.py --type registers --input_path " path_for_input_data " --output_path " path_for_output_data "转换与存档相关的XML文件:
python3 scripts/main_convert.py --type archive --input_path " path_for_input_data " --output_path " path_for_output_data "输入数据文件夹应如下构造:
input_data/
Archiv/ # Archive-related XML files
Regesten/ # Register-related XML files
Namen/ # Name-related XML files
Indicies/ # Index-related XML files git clone https://github.com/VandlJ.git
cd XMLtoJSON要开始转换,请使用主转换脚本。例如,转换所有XML文件:
python3 scripts/main_convert.py --type all --input_path " ../test_data " --output_path " ../test_data/output "您还可以查看所有可用选项,并通过运行获取详细信息:
python3 scripts/main_convert.py --help此命令将开始处理指定的--input_path目录中的XML文件,并将结果输出到--output_path目录。
该项目是从另一个团队继承的,我们进行了一些重大改进和修复以提高其功能和可靠性:
错误处理:文本中的空格/空白字符 - 在regesten文件中
display :此字段用于在前端显示文本,以确保其保留原始格式以进行可读性。processable :此字段包含文本的更清洁版本,已针对计算机处理和分析进行了优化。元数据处理:Regesten的问题元数据
.p中存在不一致之处。一些元素缺少或错误地捕获。我们进行了彻底的审查,并确保在我们的程序迭代中准确捕获和处理所有元数据元素。增强的交互性:添加信息onmouseover="highlightWords(event, '...')"
onmouseover在悬停时的单词。处理后的数据现在包括: "names" : [
{
"Aichholz_Johann" : " Johann Aichholz " ,
"alias" : " Johann Aichholz Ehrzney doctor "
},
{
"Strauben_Franz" : " Franz Strauben " ,
"alias" : " Frannzen Strauben "
}
]名称处理:通过外部工具分开名称和姓氏-Gettyulan
转换的统一主脚本
--type , --input_path和--output_path 。此更改简化了执行并增强了转换过程的灵活性。改进的文档和设置说明
性能增强和错误修复
修复Archiv类型JSON输出
hasSublink , linkTo和next_link变量的处理。这样可以确保这些变量在JSON输出中准确表示和链接。这些改进大大提高了XML对JSON Converter项目的功能,可用性和可靠性,从而使其更强大和用户友好。