icdlookup
A Python package for looking up ICD codes and mapping them to human-readable descriptions.
Ships with a built-in ICD-10-CM 2026 dataset sourced from the official CMS ICD-10 files. The hierarchy approach was inspired by rjake/ICD10-hierarchy.
The package name is version-agnostic — future releases may extend support to ICD-9, ICD-11, and other coding systems.
Installation
pip install icdlookup
For DataFrame annotation support:
pip install icdlookup[pandas]
Quick Start
Look up a single code
import icdlookup
icdlookup.lookup("A00.1")
# → "cholera due to vibrio cholerae 01, biovar eltor"
Get full hierarchy detail
icdlookup.lookup("A00.1", detail=True)
# → {
# "icd10_code": "A00.1",
# "description": "cholera due to vibrio cholerae 01, biovar eltor",
# "chapter_desc": "Certain infectious and parasitic diseases (A00-B99)",
# "section_desc": "Intestinal infectious diseases (A00-A09)",
# "category_desc": "cholera"
# }
Search by keyword
icdlookup.search("cholera")
# → [("A00", "cholera"), ("A00.0", "cholera due to ..."), ...]
Annotate a pandas DataFrame
import pandas as pd
import icdlookup
df = pd.DataFrame({"icd_code": ["A00.1", "J06.9", "E11.9"]})
df = icdlookup.annotate(df, code_column="icd_code")
# df now has an "icd_description" column
Use a custom reference CSV
Any CSV with at least icd10_code and description columns works:
icdlookup.lookup("A00.1", reference="/path/to/custom.csv")
icdlookup.annotate(df, code_column="icd_code", reference="/path/to/custom.csv")
CLI
# Single lookup
icdlookup A00.1
# Full detail
icdlookup A00.1 --detail
# Search by keyword
icdlookup --search cholera
# Annotate a CSV file
icdlookup --file data.csv --column icd_code --output annotated.csv
# Use custom reference
icdlookup A00.1 --reference /path/to/custom.csv
Design
- No pandas required for core functions —
lookup()andsearch()use only the standard library (csv+gzip). pandas is only needed forannotate(). - Case & format insensitive — lookups strip whitespace, are case-insensitive, and work with or without dots (
A001andA00.1both match). - Lazy-loaded & cached — the built-in CSV is only parsed on first use, then kept in memory for the session.
- Custom reference support — pass any CSV with
icd10_code+descriptioncolumns. - 48,600+ ICD-10-CM codes — the bundled 2026 dataset includes full hierarchy info (chapter, section, category descriptions).
Data Source
The bundled dataset is derived from the official CMS ICD-10-CM 2026 Code Tables, specifically the tabular XML file. Each code includes:
| Column | Description |
|---|---|
icd10_code |
The ICD-10-CM code (e.g. A00.1) |
description |
Human-readable description |
chapter_desc |
Chapter-level description |
section_desc |
Section-level description |
category_desc |
3-character category description |
Rebuilding the Dataset
To regenerate the bundled data from the latest CMS release:
python scripts/build_data.py
This downloads the CMS XML zip, parses the hierarchy, and writes the compressed CSV to src/icdlookup/_data/.
Development
git clone https://github.com/icdlookup/icdlookup.git
cd icdlookup
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for icdlookup 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 | Actions |
|---|---|---|---|---|
| icdlookup-0.1.0.tar.gz | 469.7 kB | With provenance | Details for icdlookup-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| icdlookup-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for icdlookup-0.1.0-py3-none-any.whl |
Total release size: 931.7 kB
Release files / icdlookup-0.1.0.tar.gz
| Download URL | icdlookup-0.1.0.tar.gz |
|---|---|
| Size | 469.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f851ab73fc1d1980b4d2f576c509bca04d4dd8914898b66d1aa1c58064ad9e96
|
|
BLAKE2b-256 checksum How to use checksums |
896bb594f9b6ca82b9a98fc4959b4c1658297118030079be3f3e604ad6e3aac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 6, 2026.
Transparency logRelease files / icdlookup-0.1.0-py3-none-any.whl
| Download URL | icdlookup-0.1.0-py3-none-any.whl |
|---|---|
| Size | 462.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc89cf90f72634258849c727e671aad55d8811792df9185ddfb061e925f7c1c4
|
|
BLAKE2b-256 checksum How to use checksums |
bf900c1fc15a94f190b617c1ef372300e8f3d364a0c3761760a33ee9cb554548
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 6, 2026.
Transparency logSecurity for icdlookup 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for icdlookup-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 6, 2026.
Transparency logA 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.