This release is a pre-release and may not be stable for production use.
HL7apy is a lightweight Python package to intuitively handle HL7 v2 messages according to HL7 specifications.
The main features includes:
- Message parsing
- Message creation
- Message validation following the HL7 xsd specifications
- Access to elements by name, long name or position
- Support to all simple and complex datatypes
- Encoding chars customization
- Message encoding in ER7 format and compliant with MLLP protocol
- Support to message profile
- Support to Z-Elements
- Simple MLLP server implementation
Currently supported HL7 versions are: 2.1, 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 2.6, 2.7, 2.8, 2.8.1, 2.8.2
This project is not affiliated with the HL7 organization: the library is just consistent with their specification.
Documentation can be found here.
Installation
HL7apy is platform independent and supports Python 3.9 and later
To install it get the latest release from GitHub and, from its root directory, launch the following command:
pip install .
Alternatively you can use pip to install it from PyPI
pip install hl7apy
External Links
Michael Sarfati wrote an interesting 2-parts article on his blog about HL7apy with useful examples and tutorials. You can read it here. Thanks a lot Michael for your contribution.
License
HL7apy is released under the MIT License.
Copyright (c) 2012-2018, CRS4
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Acknowledgments
This work has been partially funded by the following sources:
- the “Processing, Analysis, Exploration, and Sharing of Big and/or Complex Data” (XDATA) project (grant by the Sardinian Regional Authority);
- the “Data intensive Computing Forward Research Activities” (DIFRA) project (grant by the Sardinian Regional Authority).
Metadata
Release files for hl7apy 1.4.0b1
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 |
|---|---|---|---|---|
| hl7apy-1.4.0b1.tar.gz | 1.1 MB | With provenance | Details for hl7apy-1.4.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hl7apy-1.4.0b1-py3-none-any.whl | Python 3 | none | any | Details for hl7apy-1.4.0b1-py3-none-any.whl |
Total release size: 2.1 MB
Release files / hl7apy-1.4.0b1.tar.gz
| Download URL | hl7apy-1.4.0b1.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bee8d4b3b2e4d7c98f53f87b45a7a41ec91a2b623e2611f2829102825b7848f
|
|
BLAKE2b-256 checksum How to use checksums |
dba21d6d8f84b7c5997e2937b873c2c57a3d762daaf99857e53934b0773ce615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logRelease files / hl7apy-1.4.0b1-py3-none-any.whl
| Download URL | hl7apy-1.4.0b1-py3-none-any.whl |
|---|---|
| Size | 982.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
603585fb009725607f917d6243af920c70da9585d9b649cfe894874c825c54d3
|
|
BLAKE2b-256 checksum How to use checksums |
40d6b1857d6d7fd9fdab589efc3c24df216e6c1b285df329f7230cf8586081e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 26, 2026.
Transparency logSecurity for hl7apy 1.4.0b1
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 hl7apy-1.4.0b1.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 Oct 26, 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.