Python的SRU客户端
sruthi的Python项目详细描述
斯鲁西
^{str1}$sruthi是python制作SRU requests (Search/Retrieve via URL)的客户机。在
目前只支持SRU 1.2。在
目录
安装
sruthi is available on PyPI,因此要安装它,只需使用:
$ pip install sruthi
使用
有关更多脚本,请参阅^{
searchretrieve
操作
^{pr2}$
# you can get more information at each stepimportsruthi# note: records is an iteratorrecords=sruthi.searchretrieve('https://suche.staatsarchiv.djiktzh.ch/SRU/',query='Human')print(records.sru_version)print(records.count)forrecordinrecords:print(record)print(record['schema'])
searchretrieve
的返回值是iterable的,因此可以轻松地循环它。或者您可以使用索引来访问元素,例如records[1]
来获取第二个elemenet,或者使用records[-1]
来获取最后一个元素。在
{e只支持使用第1个元素^5重复
forrecordsinrecords[:5]:print(record)
explain
操作
importsruthiinfo=sruthi.explain('https://suche.staatsarchiv.djiktzh.ch/SRU/')print(info.server)print(info.database)print(info.index)print(info.schema)
模式
sruthi对记录数据模式没有任何假设。 数据按原样提供(作为扁平dict)。 sruthi已经用以下模式进行了测试:
- Dublin Core Record Schema(直流)
- MARCXML: The MARC 21 XML Schema(marcxml)
- ISAD(G): General International Standard Archival Description, Second edition(isad)
释放
要创建新版本,请遵循以下步骤(请遵守Semantic Versioning):
- 调整
sruthi/__init__.py
中的版本号 - 使用版本更新变更日志
- 创建一个pull请求,将
develop
合并到master
(确保测试通过!)在 - 创建一个new release/tag on GitHub(在主分支上)
- publication on PyPI在每个标记提交上通过GitHub Actions进行
- 项目
标签: