Skip to content

Python development

Joachim Metz edited this page May 14, 2026 · 1 revision

libhmac comes with Python-bindings named pyhmac.

Below are examples how use pyhmac. They assume you have a working version of pyhmac on your system. To build pyhmac see Building.

Import

To be able to use pyhmac in your Python scripts add the following import:

import pyhmac

Get version

The get_version() module function can be used to retrieve the version of the pyhmac.

pyhmac.get_version()

This will return a textual string (Unicode) that contains the libhmac version. Since pyhmac is a wrapper around libhmac it does not have a separate version.

Also see

import pyhmac

help(pyhmac)
help(pyhmac.None)

Clone this wiki locally