Skip to main content

The Python library helps authenticate accounts from TP Servers.

Project description

TJ-TPAuth 1.0.0

Sync

from tj_tpauth import TJTPAuth

tpauth = TJTPAuth(
    host='http://localhost:3000'
)

login_status = tpauth.login(
    username='username',
    password='password'
)

if not login_status.status:
    exit(0)

auth_status = tpauth.from_token(login_status.data.token)

if not login_status.status:
    exit(0)

print(auth_status.data)

Async

import asyncio

from tj_tpauth import TJTPAuth

tpauth = TJTPAuth(
    host='http://localhost:3000'
)


async def main():
    login_status = await tpauth.aio_login(
        username='username',
        password='password'
    )

    if not login_status.status:
        exit(0)

    auth_status = await tpauth.aio_from_token(login_status.data.token)

    if not login_status.status:
        exit(0)

    print(auth_status.data)


asyncio.run(main())

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

tj_tpauth-1.0.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

tj_tpauth-1.0.1-py3-none-any.whl (2.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