Python的SRU客户端

sruthi的Python项目详细描述


斯鲁西

^{str1}$sruthi是python制作SRU requests (Search/Retrieve via URL)的客户机。在

目前只支持SRU 1.2。在

目录

安装

sruthi is available on PyPI,因此要安装它,只需使用:

$ pip install sruthi

使用

有关更多脚本,请参阅^{} directory。在

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已经用以下模式进行了测试:

释放

要创建新版本,请遵循以下步骤(请遵守Semantic Versioning):

  1. 调整sruthi/__init__.py中的版本号
  2. 使用版本更新变更日志
  3. 创建一个pull请求,将develop合并到master(确保测试通过!)在
  4. 创建一个new release/tag on GitHub(在主分支上)
  5. publication on PyPI在每个标记提交上通过GitHub Actions进行

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何制作更好的自定义对话框?   锁定机制锁定UI线程的片段中的java Update ListView   heroku上的java调试嵌入式tomcat   java在使用键时未从映射返回特定数组   使用Blowfish生成secretKey时出现java问题   Appium\MAC OS\Android\Java组织。openqa。硒。SessionNotCreatedException   java在spring boot中解析json响应的最佳方法   java我怎样才能一行一行地看到每一行?   将Java连接到PostgreSQL时强制TZ?   java十六进制到二进制再到字符串   Spark steaming从Kafka中读取并在Java中应用Spark SQL聚合   java使用Cassandra中使用hector客户端的组合键的第一个组件获取行   java类型不匹配:无法从列表<类名>转换为游标:安卓错误   TopCoreDocCollector类型中的java方法create(int,int)不能用于参数(int,boolean)