Below you can find the extended example of how to use PBKDF2HMAC key derivation function in Python.
fernet
Symmetric data encryption with Python
One of the simplest ways to perform symmetric encryption in Python is to use Fernet algorithm from cryptography module. Let’s see how to use it.