Skip to main content

No project description provided

Project description

Upollo Python Client

The Upollo Python library can be used identify users before they login or if they visit from multiple devices.

The Python library runs on your server and can be paired with the web or mobile to protect logins or payments.

Get your API Keys

Sign up for our beta at upollo.ai/beta to get your Private API key.

Getting started

Import the package and create a client with your api key.

from userwatch import userwatch

privateApiKey = "ADD_PRIVATE_API_KEY_HERE"
userwatchClient = userwatch.Userwatch(privateApiKey)

Validate a User

To validate a user you need a token from the javascript library. See the Upollo Javascript Client Guide for how to get the token.

You also need a userId and possibly their email address or phone number, whichever is available to improve detection. You can use an email address as the id if you don't have another id.

from userwatch import userwatch
from userwatch import userwatch_public_pb2

userwatchToken = "GET FROM THE WEB CLIENT"

userInfo = userwatch_public_pb2.UserInfo(
    user_id="u_1234", # provide your user id if you have it.
    user_name="foo", # provide user name if you have it.
    user_email="foo@bar.com", # provide the email address if you have it.
    user_phone="+6100000000", # provide the phone number if you have it
)

eventType = userwatch_public_pb2.EVENT_TYPE_LOGIN

analysis = userwatchClient.verify(
  userwatchToken,
  userInfo
)

flagTypes = list(map(lambda f: f.type, analysis.flags))
isAccountSharing = userwatch_public_pb2.ACCOUNT_SHARING in flagTypes
isRepeatedTrial = userwatch_public_pb2.REPEATED_SIGNUP in flagTypes

if isAccountSharing:
    print("user is account sharing")

if isRepeatedTrial:
    print("user is repeating trial")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

userwatch_python-0.0.6-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file userwatch_python-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for userwatch_python-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd0d439b42c59d5f20e1bb4aa9c11e1210159190b877d2c047d63ff13b95970
MD5 578866a21fa8d7ae656f7e8209f967e9
BLAKE2b-256 887499524f78c70638461cee1792495db2d6f7fdc33e45ca59700e61049ab292

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page