这是一个库,用于与由EBI托管的Human Cell Atlas摄取API进行通信,用于创建和管理HCA项目提交。
项目描述
摄取客户端
此存储库包含可以跨摄取服务共享的hca-ingest Python包库。
安装
pip install hca-ingest
使用
API包
要在您的Python脚本中使用摄取API接口
from hca_ingest.api.ingestapi import IngestApi
通过设置INGEST_API环境变量来配置要使用的摄取URL
INGEST_API=http://localhost:8080
Schema模板包
Schema模板包提供了在HCA JSON模式中查找属性的方便方法。JSON模式中的每个属性都表示为以模式名称为前缀的简单键。
第一个元素是模式简称,后面跟着属性。例如,在donor_organism模式中,biomaterial_id属性的键是donor_organism.biomaterial_core.biomaterial_id
。
模式模板提供了访问每个键的属性,这对于开发需要查询或根据JSON模式生成JSON文档的模式感知应用程序非常有用。
键 | 描述 | 示例 |
---|---|---|
{key}.schema.high_level_entity | 告诉您属性是否属于type 、module 或core 模式 |
donor_organism.biomaterial_core.schema.high_level_entity = core, donor_organism.schema.high_level_entity = type, donor_organism.medical_history.schema.high_level_entity = module |
{key}.schema.domain_entity | 告诉您属性是否位于biomaterial 、file 、process 、protocol 、analysis 或project 模式中 |
donor_organism.schema.domain_entity = biomaterial, dissociation_protocol.schema.domain_entity = protocol, dissociation_protocol.schema.domain_entity = protocol, sequence_file.schema.domain_entity = File |
{key}.schema.module | 告诉您定义此属性的模式名称 | donor_organism.schema.domain_entity = biomaterial, dissociation_protocol.schema.module = dissociation_protocol, dissociation_protocol.schema.module = dissociation_protocol, donor_organism.medical_history.schema.module = medical_history |
{key}.schema.url | 提供定义此属性的模式的全URL | donor_organism.medical_history.schema.url = https://schema.humancellatlas.org/module/biomaterial/5.1.0/medical_history |
{key}.value_type | 告诉您此属性的预期值类型。可以是object 、string 或integer 之一 |
donor_organism.medical_history.medication.value_type = string, sequence_file.lane_index.value_type = integer, sequence_file.file_core.value_type = object |
{key}.multivalue | 告诉您值是单个值还是值的数组 | sequence_file.insdc_run.multivalue = True |
{key}.user_friendly | 属性的友好名称 | sequence_file.insdc_run.multivalue = INSDC run |
{key}.description | 属性的简要描述 | sequence_file.insdc_run.multivalue = An INSDC (International Nucleotide Sequence Database Collaboration) run accession. Accession must start with DRR, ERR, or SRR. |
{key}.format | 告诉您属性是否有特定的格式,如日期格式 | project.contact.email.format = email |
{key}.required | 告诉您属性是否必需 | donor_organism.biomaterial_core.biomaterial_id.required = True |
{key}.identifiable | 告诉您属性是否是当前实体的可识别字段 | donor_organism.biomaterial_core.biomaterial_id.identifiable = True, donor_organism.biomaterial_core.biomaterial_name.identifiable = False |
{key}.external_reference | 告诉您属性是否是全局可识别的,因此可以从摄入中检索可检索的对象 | donor_organism.uuid.external_reference = True |
{key}.example | 此属性预期值的示例 | project.contact.contact_name.example = John,D,Doe |
开发者说明
此包目前仅与Python 3兼容。
需求
此项目的要求列在2个文件中:requirements.txt
和dev-requirements.txt
。 dev-requirements.txt
文件包含特定于开发的依赖项
需求文件(requirements.txt
、dev-requirements.txt
)使用pip-tools的pip-compile
生成
pip-compile requirements.in
pip-compile dev-requirements.in
直接依赖项列在requirements.in
、dev-requirements.in
输入文件中。
安装依赖项
- 使用
pip-tools
中的pip-sync
pip-sync requirements.txt dev-requirements.txt
- 或直接使用
pip install
pip install -r requirements.txt
pip install -r dev-requirements.txt
升级依赖项
要更新所有包,定期重新运行pip-compile --upgrade
要更新特定包到最新版本或指定版本,使用--upgrade-package
或-P
标志
pip-compile --upgrade-package requests
有关更多选项,请参阅pip-compile的文档。
运行测试
要运行所有测试,请使用 unittest
包
python -m unittest
以可编辑模式开发代码
使用 pip
的可编辑模式,客户端项目可以直接引用此存储库中的最新代码,而无需通过 PyPI 安装。这可以通过手动克隆代码库来实现
pip install -e path/to/ingest-client
或者通过为 pip
提供对存储库的引用来自动执行
pip install -e \
git+https://github.com/HumanCellAtlas/ingest-client.git\
#egg=hca_ingest
有关 pip
的版本控制系统支持的更多信息,请参阅 VCS 支持文档。
发布到 PyPI
项目详情
hca-ingest-2.8.0.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5eae824865217d11b2c645b1cdb5c719a8966c0f956a4f948a2480772d007573 |
|
MD5 | 1ee56ad329522998ac6e6d5126d33e5d |
|
BLAKE2b-256 | 78eb79d76afcc921b3cbc4ad0c8d26dd4088da28dd629c9bbe697fb226d5e0e7 |