skillfed

hl7apy

HL7apy: a lightweight Python library to parse, create and handle HL7 v2.x messages

hl7apy v1.3.5 802.9K downloads/30d#5,018 on PyPI
Permissive license MIT License DORMANT released

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 hl7apy

uv

uv add hl7apy

poetry

poetry add hl7apy

Installing 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

Intended Audience :: Healthcare IndustryLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Tags

hl7 message parsing pythonhl7 v2 healthcare messageshl7 message creation validationhl7 er7 encodinghealthcare data interchange pythonhl7 mllp protocolparse hl7 messages
healthcare-datahl7-v2message-parsing

More Scientific/Engineering packages