umls-api
Python client for https://documentation.uts.nlm.nih.gov/rest/home.html
Installation
pip install umls-api
Example Usage
Get 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'
}
Get 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.'
}
}
If you wish to add support for other API endpoints on UMLS, they are very simple to add.
Pull requests (with tests) are very welcome.
Running the tests
pip install -r requirements-dev.txt
pytest src/tests
flake8
Release History
0.1.0 (2020-12-01)
- Initial release.
Metadata
Release files for umls-api 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| umls-api-0.1.0.tar.gz | 4.6 kB | Without provenance | Details |
Release files / umls-api-0.1.0.tar.gz
| Download URL | umls-api-0.1.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
441edfcd4cc6540cc40cf85b00bee89654936c5b81e62bcde1c1a509a416201b
|
|
BLAKE2b-256 checksum How to use checksums |
f73a6e9f161f16ffa6c7559857ec60122446c2d56f93b7b882b3d936a596c616
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.0
|
Security for umls-api 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.