Skip to main content

A Panda-Auth library for Python.

Project description

PandaAuthPy

PandaAuthPy is a Panda-Auth library for Python 🐍

Installation

Install the package using pip:

pip install PandaAuthPy

Usage

Import the module and create an instance of PandaAuth:

from PandaAuth import PandaAuth

auth = PandaAuth()

1. Get Key

Generates a key URL for your service.

service_name = "your_service"
print(auth.get_key(service_name))

Returns: A URL where the user can get the key.

2. Validate Key

Checks if the given key is valid.

key = input("Enter your key: ")
if auth.validate_key(key, service_name):
    print("Key is valid.")
else:
    print("Key is invalid.")

Returns: True if the key is valid, otherwise False.

3. Validate Premium Key

Checks if the given key has premium access.

key = input("Enter your key: ")
if auth.validate_premium_key(key, service_name):
    print("Key is premium.")
else:
    print("Key is not premium.")

Returns: True if the key has premium status, otherwise False.

4. Example

from PandaAuthPy import PandaAuth

if __name__ == "__main__":
    auth = PandaAuth()
    
    service_name = "your_service"
    
    print(auth.get_key(service_name)) # Prints the key URL
    key = input("Enter your key: ")
    if auth.validate_key(key, service_name):
        if auth.validate_premium_key(key, service_name):
            print("Key is valid and premium.") # Return if key is premium
        else:
            print("Key is valid but not premium.") # Return if key is not premium
    else:
        print("Invalid key.") # Return if key is not valid

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

pandaauthpy-1.0.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

pandaauthpy-1.0.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file pandaauthpy-1.0.2.tar.gz.

File metadata

  • Download URL: pandaauthpy-1.0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pandaauthpy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c9befdd8c1f5443bbe6797da47ac3d67d457cbba0f5f89481cb0b8326a905984
MD5 b73d92962b969a54eda30cb7e16c2cb8
BLAKE2b-256 1fbb749983efa7c421136a09dc926acb724e1375bb86062fbe2726db96d8c610

See more details on using hashes here.

File details

Details for the file pandaauthpy-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pandaauthpy-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pandaauthpy-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c13d66e76bdacafd77b71b65837f206abe38f2636565903125095a2322001ab
MD5 ac187b3f31754d2cf1574576664d9cce
BLAKE2b-256 8513432a98dc0605e4b720c8e6e834ff4ce5d3e48f81ef6806b80de3ac08abee

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