与APICURON交互的客户端
项目描述
APICURON客户端
用于与APICURON编目元数据库交互的非官方客户端。
💪 入门
以下示例展示了如何将新资源提交给APICURON。由于apicuron_client
在内部使用PyDantic,JSON将被验证并自动转换为程序模型。Description.update_remote()
函数负责与API交互并从环境或包含pystow
(pystow
)的配置文件中加载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
本包是用@audreyfeldroy的cookiecutter包和@cthoyt的cookiecutter-snekpack模板创建的。
🛠️ 开发者
README的最后一部分是为那些想要通过代码贡献来参与其中的人准备的。
❓ 测试
在克隆存储库并使用pip install tox
安装tox
后,可以反复运行tests/
文件夹中的单元测试。
$ tox
此外,这些测试会随着每次提交自动重新运行,在GitHub Action中。
📦 制作发布版
在开发模式下安装包并使用pip install tox
安装tox
后,在tox.ini
中的finish
环境中包含了制作新版本的命令。请在shell中运行以下命令:
$ tox -e finish
此脚本执行以下操作:
- 使用BumpVersion将
setup.cfg
和src/apicuron_client/version.py
中的版本号切换,去掉-dev
后缀。 - 以tar存档和wheel的形式打包代码。
- 使用
twine
上传到PyPI。请确保有一个配置好的.pypirc
文件,以避免在此步骤中需要手动输入。 - 推送到GitHub。您需要创建一个与版本提升提交相对应的发布版。
- 将版本提升到下一个修补程序。如果您进行了重大更改并希望通过次要版本提升版本,可以在之后使用
tox -e bumpversion minor
。
项目详情
apicuron_client-0.1.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 228e3223cc858a428b0fb1ab65b171e93ad1c3ef9ee7d7f6314c9ac88683d8d1 |
|
MD5 | 55aa11ebe9a6948d5aaa039428fb012b |
|
BLAKE2b-256 | 66d5a956240b945007d4082fbb218b0704edcbe254acedb2f61232262c3a55f8 |
apicuron_client-0.1.3-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7885c45190249b6b2e726e40181d9f4cd06760e07a06cec91aabf3ba5a478f9a |
|
MD5 | cdc9beb0d378c056963eff91c55a2df4 |
|
BLAKE2b-256 | 96ad517f9077149c1408f70df151b9d309d6413230cec9105e35fba905e186cf |