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.1.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.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pandaauthpy-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cc9df2b4fb2b07c4973ad8dccdece5768a177659aa00a02010510ac990448e7e
MD5 abd38aecf31a3e3248ac2fc359980709
BLAKE2b-256 7d949a89bb587e5c0403abb4640efcb33542513114228c1b415485651f94d6ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pandaauthpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 668431d29da8163fa8254f8bb65be6d43bf08c5a12c98ad3e938902c065da658
MD5 c4acf1c9d51e9658e1626ce5eba84d7a
BLAKE2b-256 5cc66da4aef986c3e48c7775e4b1f040c054f248cb1e0937a9d3b1a50e00dac0

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