hl7apy
HL7apy: a lightweight Python library to parse, create and handle HL7 v2.x messages
What it is and what it does
HL7apy is a Python library for working with HL7 v2.x messages, the standard format for healthcare data interchange. It handles the full lifecycle: parsing incoming messages into structured objects, creating new messages programmatically, and validating them against HL7 specifications. The library supports all HL7 datatypes (simple and complex), allows custom encoding characters, and can encode messages in ER7 format with MLLP protocol compliance.
The package has no external dependencies and installs as a pure-Python wheel, making it lightweight and portable. It's aimed at healthcare IT developers building systems that need to send or receive HL7 messages. However, the project has been dormant for 884 days with no recent releases, so it receives no active maintenance; use it when you need HL7 v2 support in a stable, unchanging codebase.
Use it for:
- Parse incoming HL7 admission/discharge/transfer messages from hospital systems into Python objects for processing.
- Generate HL7 messages programmatically to send patient data to external healthcare systems or EHRs.
- Validate HL7 messages against HL7 specifications before transmission to ensure compliance.
- Extract specific fields from HL7 messages by name or position for data integration pipelines.
- Build MLLP-compliant healthcare data interchange endpoints that receive and send HL7 v2 messages.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
HL7apy parses, creates, and validates HL7 v2.x healthcare messages according to HL7 specifications, with support for all datatypes, custom encoding, and MLLP protocol compliance.
Yes, if you need HL7 v2 message handling in Python and can accept a dormant package. The library is lightweight, has no dependencies, carries permissive licensing, and has seen no reported security issues. Install it for stable, read-only HL7 work; avoid it if you need active maintenance, bug fixes, or support for emerging HL7 standards.
Install
hl7apy on PyPI
pip
pip install hl7apyuv
uv add hl7apypoetry
poetry add hl7apyInstalling hl7apy
Before you install
No runtime dependencies and a pure-Python wheel distribution mean installation is straightforward. The package is dormant—no releases in 884 days—so expect no active maintenance or bug fixes, though the codebase appears stable for existing use cases.
License in practice
MIT License is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute hl7apy freely as long as you include the license notice.
Quickstart
pip install hl7apy
from hl7apy.core import Message
msg = Message('ADT')
msg.parse('MSH|^~\\&|...')
Verify before relying
- Whether the package works reliably with modern Python versions (3.10, 3.11, 3.12) despite dormant status.
- Current state of documentation and whether examples remain accurate for HL7 v2 specifications.
- Whether MLLP protocol support is production-ready or limited to basic encoding/decoding.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 884 days since the last release |
| First released | |
| Downloads | 802,892/month — #5,018 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hl7apy-1.3.5-py2.py3-none-any.whl
Keywords: HL7, Health Level 7, healthcare, python
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
hl7Parses HL7 version 2.x medical messages into…
permissive · top 15,000 on PyPI
fhir.resourcesProvides Python classes and validation for all…
permissive · top 5,000 on PyPI
fhir-coreProvides Pydantic V2-based abstract base…
permissive · top 5,000 on PyPI
pyproject-tomlParses and validates Python project metadata…
permissive · top 15,000 on PyPI
pyx12Pyx12 parses, validates, and converts ANSI X12…
permissive · top 15,000 on PyPI
semantic-versionParses, validates, and compares semantic…
permissive · top 1,000 on PyPI
emrvalidatorEMRValidator is a data validation library…
permissive · top 15,000 on PyPI
pyiso8583Serializes and deserializes ISO8583 financial…
permissive · top 15,000 on PyPI
carelyticsCarelytics provides healthcare data cleaning,…
permissive · top 15,000 on PyPI
reqifReqIF is a Python library for parsing,…
permissive · top 15,000 on PyPI