跳转到主要内容

未提供项目描述

项目描述

umls-api

Python客户端,用于https://documentation.uts.nlm.nih.gov/rest/home.html

安装

pip install umls-api

示例用法

获取CUI。

import umls_api

resp = umls_api.API(api_key='<UMLS_API_KEY_HERE>').get_cui(cui='C0007107')
print(res)
{
	'pageCount': 1,
	'pageNumber': 1,
	'pageSize': 25,
	'result': {
		'atomCount': 247,
		'atoms': 'https://uts-ws.nlm.nih.gov/rest/content/2020AB/CUI/C0007107/atoms',
		'attributeCount': 0,
		'classType': 'Concept',
		'cvMemberCount': 0,
		'dateAdded': '09-30-1990',
		'defaultPreferredAtom': 'https://uts-ws.nlm.nih.gov/rest/content/2020AB/CUI/C0007107/atoms/preferred',
		'definitions': 'https://uts-ws.nlm.nih.gov/rest/content/2020AB/CUI/C0007107/definitions',
		'majorRevisionDate': '06-25-2020',
		'name': 'Malignant neoplasm of larynx',
		'relationCount': 17,
		'relations': 'https://uts-ws.nlm.nih.gov/rest/content/2020AB/CUI/C0007107/relations',
		'semanticTypes': [{
			'name': 'Neoplastic Process',
			'uri': 'https://uts-ws.nlm.nih.gov/rest/semantic-network/2020AB/TUI/T191'
		}],
		'status': 'R',
		'suppressible': False,
		'ui': 'C0007107'
	}

获取TUI。

import umls_api

resp = umls_api.API(api_key='<UMLS_API_KEY_HERE>').get_tui(cui='T047')
print(resp)
{
	'pageCount': 1,
	'pageNumber': 1,
	'pageSize': 25,
	'result': {
		'abbreviation': 'dsyn',
		'childCount': 2,
		'classType': 'SemanticType',
		'definition': 'A condition which alters or interferes with a '
		'normal process, state, or activity of an organism. '
		'It is usually characterized by the abnormal '
		"functioning of one or more of the host's systems, "
		'parts, or organs. Included here is a complex of '
		'symptoms descriptive of a disorder.',
		'example': 'NONE',
		'name': 'Disease or Syndrome',
		'nonHuman': 'NONE',
		'semanticTypeGroup': {
			'abbreviation': 'DISO',
			'classType': 'SemanticGroup',
			'expandedForm': 'Disorders',
			'semanticTypeCount': 12
		},
		'treeNumber': 'B2.2.1.2.1',
		'ui': 'T047',
		'usageNote': 'Any specific disease or syndrome that is modified by '
		'such modifiers as "acute", "prolonged", etc. will '
		'also be assigned to this type. If an anatomic '
		'abnormality has a pathologic manifestation, then it '
		'will be given this type as well as a type from the '
		"'Anatomical Abnormality' hierarchy, e.g., "
		'"Diabetic Cataract" will be double-typed for this '
		'reason.'
	}
}

如果您希望添加对UMLS其他API端点的支持,这非常简单。

欢迎提交带有测试的拉取请求。

运行测试

pip install -r requirements-dev.txt
pytest src/tests
flake8

发布历史

0.1.0 (2020-12-01)

  • 初始发布。

项目详情


下载文件

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

源分布

umls-api-0.1.0.tar.gz (4.6 kB 查看哈希值)

上传时间

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面