HL7 Python Library

The library being used to build the Hl7 messages is http://crs4.github.io/hl7apy/ (https://github.com/crs4/hl7apy)

A Two Part Blog on using the python library https://msarfati.wordpress.com/2015/06/20/python-hl7-v2-x-and-hl7apy-introduction-and-parsing-part-1/ (source https://github.com/msarfati/hl7apy-tutorial)


This a python port of the Java Hapi library (https://hapifhir.github.io/hapi-hl7v2/) there is also a .NET port (http://nhapi.sourceforge.net/home.php). There are also a number of tuorials using the HAPI library such as https://saravanansubramanian.com/hl7tutorials/  Due the python library being a port of JAVA is less pythonic than may be liked so it may be easier to look at how to use the HAPI library in Java then replicate in python. 


Another possible library is https://github.com/norlowski/HL7py .