🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

pyuuidapikey

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyuuidapikey

A Simple package to generate and validate UUID and API key pairs

0.0.3
PyPI
Maintainers
1

pyuuidapikey

A Simple package to generate and validate uuid and apikey key pairs

Install

pip install pyuuidapikey

Example

Generate Keys

from pprint import pprint
from pyuuidapikey import UUIDAPIKey

uuidapikey = UUIDAPIKey()

keys: dict = uuidapikey.generate()
pprint(keys)

Output

{
	'apikey': 'TPICACD6-W97D3LB1-473P6SN5-1VNG9X4J',
	'uuid': '95f0aac2-3681-4ab1-89a2-6ea5614a191f'
}

Validate Keys

from pyuuidapikey import UUIDAPIKey

apikey: str = 'TPICACD6-W97D3LB1-473P6SN5-1VNG9X4J'
uuid: str = '95f0aac2-3681-4ab1-89a2-6ea5614a191f'

uuidapikey = UUIDAPIKey()

is_valid: bool = uuidapikey.validate(apikey, uuid)
print(is_valid)

Output

True

Inspired the works from the JS library,

  • https://www.npmjs.com/package/uuid-apikey
  • https://github.com/chronosis/uuid-apikey

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts