Giter Site home page Giter Site logo

py-umls's Introduction

UMLS for Python

These are basic tools to interact with UMLS lexica, namely UMLS, SNOMED and RxNorm, using Python 3 scripts. For each of the three databases there are scripts (2 Bash and 1 Python) that facilitate import of the downloaded data into a local SQLite 3 database.

You will need a UMLS license to download UMLS lexica.

For a simple start, run one of the files (umls.py, snomed.py, rxnorm.py) in your Shell and follow the instructions. The scripts will prompt you to download and install the databases and, when completed, print a simple example lookup.

There are also utility scripts that offer help for specific use cases, see below.

Documentation

An auto-generated documentation (via Sphinx) is available but not very exhaustive at the moment. See below for some quick examples.

Usage

More detailed (at one point) instructions here:

There are XYLookup classes in each of the three files which can be used for database lookups (where XY stands for UMLS, SNOMED or RxNorm). The following example code is appended to the end of the respective scripts and will be executed if you run it in the Shell. You might want to insert XY.check_databases() before this code so you will get an exception if the databases haven't been set up.

look_umls = UMLSLookup()
code_umls = 'C0002962'
meaning_umls = look_umls.lookup_code_meaning(code_umls)
print('UMLS code "{0}":     {1}'.format(code_umls, meaning_umls))

look_snomed = SNOMEDLookup()
code_snomed = '215350009'
meaning_snomed = look_snomed.lookup_code_meaning(code_snomed)
print('SNOMED code "{0}":  {1}'.format(code_snomed, meaning_snomed))

look_rxnorm = RxNormLookup()
code_rxnorm = '328406'
meaning_rxnorm = look_rxnorm.lookup_code_meaning(code_rxnorm, preferred=False)
print('RxNorm code "{0}":     {1}'.format(code_rxnorm, meaning_rxnorm))

You would typically use this module as a submodule in your own project. Best add this as a git submodule but that really is up to you. If you do use this module as a Python module, you can't use the name py-umls because it contains a dash, so you must checkout this code to a correctly named directory. I usually use umls.

License

This work is Apache licensed.

py-umls's People

Contributors

p2 avatar jmandel avatar

Watchers

James Cloos avatar Liyosi Collins avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.