Skip to main content

Pulse Security - Python SDK

Project description

Pulse Security - Python SDK

Installation

$ pip install pulsesec

Example

from pulse import Pulse, TokenNotFoundError, TokenUsedError, TokenExpiredError
import os


async def main():
    client = Pulse(os.getenv("PULSE_SITE_KEY"), os.getenv("PULSE_SECRET_KEY"))

    async def classify(token: str) -> bool:
        try:
            is_bot = await client.classify(token)
            return is_bot
        except TokenNotFoundError:
            raise "Token not found"
        except TokenUsedError:
            raise "Token already used"
        except TokenExpiredError:
            raise "Token expired"
        except Exception as e:
            raise e

Project details


Download files

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

Source Distribution

pulsesec-0.0.5.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

pulsesec-0.0.5-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

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