Use Nuget to install the Enzoic package in your project:
pipinstallenzoic
3. Try Out Our Example Code
We’ve made calling the API dead simple. This sample code snippet shows you examples of calling the four primary APIs:
# Create a new instance of the Enzoic class - this is our primary interface for making API callsfrom enzoic import Enzoicenzoic =Enzoic("YOUR_API_KEY", "YOUR_API_SECRET")# Check whether a password has been compromisedif enzoic.check_password("password_to_test"):print("Password is compromised")else:print("Password is not compromised")# Check whether a specific set of credentials are compromisedif enzoic.check_credentials("test@enzoic.com", "password_to_test"):print("Credentials are compromised")else:print("Credentials are not compromised")# Use the optional parameters on the check_credentials call to tweak performance # by including the date/time of the last check and excluding BCrypt if enzoic.check_credentials("test@enzoic.com", "password_to_test", last_check_datetime_object, [PasswordType.Bcrypt]):print("Credentials are compromised")else:print("Credentials are not compromised")# Get all exposures for a given userexposures = enzoic.get_exposures_for_user("test@enzoic.com")print(str(exposures["count"] +" exposures found for test@enzoic.com")# Now get the full details for the first exposure returned in the exposures response abovedetails = enzoic.get_exposure_details(exposures["exposures"][0])print("First exposure for test@enzoic.com was "+ details["title"])