Package: hca-ingest
Ingest ClientThis repository contains the hca-ingest Python package library which can be shared across ingest services.Installationpip install hca-ingestUsageAPI packageTo use the Ingest API interface in your python scriptfrom hca_ingest.api.ingestapi import IngestApiConfigure the ingest url to be used by setting the environment variable for INGEST_APIINGEST_API=http://localhost:8080Schema template packageThe schema template package provides convenient lookup of properties in the HCA JSON schema.
Each property in the JSON schema is represented as a simple key that is prefixed with the schema name.The first element is the short name for the schema followed by the property. e.g the key for the biomaterial_id property in the
donor_organism schema isdonor_organism.biomaterial_core.biomaterial_id.The schema template provides access to attributes of each key that is useful for developing schema aware applications that need to query or generate JSON documents against the JSON schema.KeyDescriptionExamples{key}.schema.high_level_entityTells you if the property is part oftype,moduleorcoreschemadonor_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_entityTells you if the property is in abiomaterial,file,process,protocol,analysisorprojectschemadonor_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.moduleTells you the name of the schema where this property is defineddonor_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.urlGives you the full URL to the schema where this property is defineddonor_organism.medical_history.schema.url=https://schema.humancellatlas.org/module/biomaterial/5.1.0/medical_history{key}.value_typeTells you the expected value stype for this property. Can be one ofobject,string,integerdonor_organism.medical_history.medication.value_type= string,sequence_file.lane_index.value_type= integer,sequence_file.file_core.value_type= object{key}.multivalueTells you in the value is a single value or an array of valuessequence_file.insdc_run.multivalue= True{key}.user_friendlyThe user friendly name for the propertysequence_file.insdc_run.multivalue= INSDC run{key}.descriptionA short description of the propertysequence_file.insdc_run.multivalue= An INSDC (International Nucleotide Sequence Database Collaboration) run accession. Accession must start with DRR, ERR, or SRR.{key}.formatTell you if the property has a specific format, like a date formatproject.contact.email.format= email{key}.requiredTells you if the property is requireddonor_organism.biomaterial_core.biomaterial_id.required= True{key}.identifiableTells you if the property is an identifiable field for the current entitydonor_organism.biomaterial_core.biomaterial_id.identifiable= True,donor_organism.biomaterial_core.biomaterial_name.identifiable= False{key}.external_referenceTells you if the property is globaly identifiable and therefore retrievable a retrievable object from ingestdonor_organism.uuid.external_reference= True{key}.exampleAn example of the expected value for this propertyproject.contact.contact_name.example= John,D,DoeDeveloper NotesThis package is currently only compatible with Python 3.RequirementsRequirements for this project are listed in 2 files:requirements.txtanddev-requirements.txt.
Thedev-requirements.txtfile contains dependencies specific for developmentThe requirement files (requirements.txt,dev-requirements.txt) are generated usingpip-compilefrompip-toolspip-compile requirements.in
pip-compile dev-requirements.inThe direct dependencies are listed inrequirements.in,dev-requirements.ininput files.Install dependenciesby usingpip-syncfrompip-toolspip-sync requirements.txt dev-requirements.txtor by just usingpip installpip install -r requirements.txt
    pip install -r dev-requirements.txtUpgrade dependenciesTo update all packages, periodically re-runpip-compile --upgradeTo update a specific package to the latest or a specific version use the--upgrade-packageor-Pflag:pip-compile --upgrade-package requestsSee more options in the pip-compiledocumentation.Running the TestsTo run all the tests, useunittestpackage:python -m unittestDeveloping Code in Editable ModeUsingpip's editable mode, client projects can refer to the latest code in this repository
directly without installing it through PyPI. This can be done either by manually cloning the code
base:pip install -e path/to/ingest-clientor by havingpipdo it automatically by providing a reference to this repository:pip install -e \
git+https://github.com/HumanCellAtlas/ingest-client.git\
#egg=hca_ingestFor more information on version control support withpip, refer to theVCS
support documentation.Publish to PyPICreate PyPI Account through theregistration page.Take note that PyPI requires email addresses to be verified before publishing.Package the project for distribution.python setup.py sdistTake note thatsetup.pyis configured to build a distribution with namehca-ingest.InstallTwinepip install twineUpload the distribution package to PyPI.twine upload dist/*Runningpython setup.py sdistwill create a package in thedistdirectory of the project
base directory. Specific packages can be chosen if preferred instead of the wildcard*:twine upload dist/hca_ingest-0.1a0.tar.gz