跳转到主要内容

与APICURON交互的客户端

项目描述

APICURON客户端

Tests Cookiecutter template from @cthoyt PyPI PyPI - Python Version PyPI - License Documentation Status DOI Code style: black

用于与APICURON编目元数据库交互的非官方客户端。

💪 入门

以下示例展示了如何将新资源提交给APICURON。由于apicuron_client在内部使用PyDantic,JSON将被验证并自动转换为程序模型。Description.update_remote()函数负责与API交互并从环境或包含pystowpystow)的配置文件中加载APICURON_TOKEN

from apicuron_client import Description

payload = {
   "resource_id": "Biomappings",
   "resource_name": "Biomappings",
   "resource_uri": "https://biomappings.github.io/biomappings/",
   "resource_url": "https://biomappings.github.io/biomappings/",
   "resource_long_name": "Biomappings",
   "resource_description": "Community curated and predicted equivalences and related mappings between named biological entities that are not available from primary sources.",
   "terms_def": [
      {
         "activity_term": "novel_curation",
         "activity_name": "Curated novel mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Curated a novel mapping between two entities"
      },
      {
         "activity_term": "validate_prediction",
         "activity_name": "Validate predicted mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Affirmed the correctness of a predicted mapping"
      },
      {
         "activity_term": "invalidate_prediction",
         "activity_name": "Invalidate predicted mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Affirmed the incorrectness of a predicted mapping"
      }
   ],
   "achievements_def": [
      {
         "category": "1",
         "name": "Newbie curator",
         "count_threshold": 10,
         "type": "badge",
         "list_terms": [
            "novel_curation",
            "validate_prediction",
            "invalidate_prediction"
         ],
         "color_code": "#055701"
      }
   ]
}
description = Description(**payload)
description.update_remote()

结果可以在APICURON网站上查看,网址为https://apicuron.org/database?resource_uri=https:%2F%2Fbiomappings.github.io%2Fbiomappings%2F

🚀 安装

最新版本可以通过PyPI进行安装。

$ pip install apicuron_client

最新代码和数据可以直接从GitHub安装。

$ pip install git+https://github.com/cthoyt/apicuron-client.git

要在开发模式下安装,请使用以下命令:

$ git clone git+https://github.com/cthoyt/apicuron-client.git
$ cd apicuron-client
$ pip install -e .

👏 贡献

无论您是提交问题、发起拉取请求还是进行分叉,您的贡献都备受赞赏。有关如何参与的信息,请参阅CONTRIBUTING.rst

👀 稿件归属

⚖️ 许可证

本包中的代码受MIT许可证的许可。

📖 引用

本项目并非APICURON团队官方项目,但如果您喜欢它,请引用他们的论文。

@article{Hatos2021,
   author = {Hatos, Andr{\'{a}}s and Quaglia, Federica and Piovesan, Damiano and Tosatto, Silvio C E},
   doi = {10.1093/database/baab019},
   issn = {1758-0463},
   journal = {Database},
   month = {apr},
   title = {{APICURON: a database to credit and acknowledge the work of biocurators}},
   url = {https://academic.oup.com/database/article/doi/10.1093/database/baab019/6244733},
   volume = {2021},
   year = {2021}
}

致谢

🍪 Cookiecutter

本包是用@audreyfeldroycookiecutter包和@cthoytcookiecutter-snekpack模板创建的。

🛠️ 开发者

README的最后一部分是为那些想要通过代码贡献来参与其中的人准备的。

❓ 测试

在克隆存储库并使用pip install tox安装tox后,可以反复运行tests/文件夹中的单元测试。

$ tox

此外,这些测试会随着每次提交自动重新运行,在GitHub Action中。

📦 制作发布版

在开发模式下安装包并使用pip install tox安装tox后,在tox.ini中的finish环境中包含了制作新版本的命令。请在shell中运行以下命令:

$ tox -e finish

此脚本执行以下操作:

  1. 使用BumpVersion将setup.cfgsrc/apicuron_client/version.py中的版本号切换,去掉-dev后缀。
  2. 以tar存档和wheel的形式打包代码。
  3. 使用twine上传到PyPI。请确保有一个配置好的.pypirc文件,以避免在此步骤中需要手动输入。
  4. 推送到GitHub。您需要创建一个与版本提升提交相对应的发布版。
  5. 将版本提升到下一个修补程序。如果您进行了重大更改并希望通过次要版本提升版本,可以在之后使用tox -e bumpversion minor

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分布

apicuron_client-0.1.3.tar.gz (15.2 kB 查看哈希值)

上传时间 源代码

构建分布

apicuron_client-0.1.3-py3-none-any.whl (9.1 kB 查看哈希值)

上传时间 Python 3

由以下支持