FusionAuth Python Client

Python Client Library

The Python client library allows you to integrate FusionAuth with your Python application.

Source code:

PyPI Package:

To install the FusionAuth Python Client package run:

pip install fusionauth-client

The following code assumes FusionAuth is running on http://localhost:9011 and uses an API key 6b87a398-39f2-4692-927b-13188a81a9a3, you will need to supply your own API key, and if you are not running FusionAuth locally, your host parameter may be different.

Here is an example of using the create_user method to create, and then the retrieveUserByEmail method to retrieve the User by email address.

from fusionauth.fusionauth_client import FusionAuthClient


#  You must supply your API key and URL here
client = FusionAuthClient('6b87a398-39f2-4692-927b-13188a81a9a3', 'http://localhost:9011')

user_request = {
    'sendSetPasswordEmail': False,
    'skipVerification': True,
    'user': {
        'email': 'art@vandaleyindustries.com',
        'password': 'password'
    }
}

client_response = client.create_user(None, user_request)

# Create a User
if client_response.was_successful():
    print(client_response.success_response)
else:
    print(client_response.error_response)

# Retrieve a user by email address
client_response = client.retrieve_user_by_email('art@vandaleyindustries.com')
if client_response.was_successful():
    print(client_response.success_response)
else:
    print(client_response.error_response)