Skip to main content

Sassy Python Database (and auth) utils

Project description

=====================================

Sassy Python Database(and auth) utils

=====================================

Requirements

============

  • Python 3.7 or higher
  • pyotp
  • qrcode
  • setuptools

Usage

=====

import spdb

Database


spdb.Database(path: str)
spdb.Database.create_tables(tables_names: list[str]) -> None
spdb.Database.execute(code) -> str
spdb.Database.read_dict(name: str, data_id: str) -> dict
spdb.Database.read_object(Class: class, name: str, data_id: str) -> Class
spdb.Database.write_dict(name: str, data_id: str, data: dict) -> None
spdb.Database.write_object(name: str, object_id: str, object: Class) -> None

Static:
	spdb.Database.object_to_dict(object: Class) -> dict
	spdb.Database.dict_to_object(Class: class, Dict: dict) -> Class

TOTP - HOTP


spdb.OTP(token: str=None, app_name: str=None)
spdb.OTP.now() -> str
stdb.OTP.at(index: int) -> str
stdb.OTP.time_verify(code: str) -> bool
stdb.OTP.counter_verify(index: int, code: str) -> bool
stdb.OTP.TQR(name: str) ->
stdb.OTP.HQR(name: str) ->

Static:
	stdb.OTP.generate_token() -> str

Token Generator


stdb.TokenGenerator(code: str)
stdb.TokenGenerator.gen(type: str, ID: str, key: str) -> str

Static:
	stdb.TokenGenerator.parse_token(token: str) -> dict

Text Validator


stdb.TextValidator(min: int=4, max: int=64, regexp: str=r'([A-z]|[0-9]|_|-)+')
stdb.TextValidator.check(text: str) -> bool

Utils


stdb.utils.sha256(text: str) -> str
stdb.utils.b32encode(text: str) -> str
stdb.utils.random_text(length: int=None) -> str
stdb.utils.random_sha256() -> str
stdb.utils.random_b32 -> str

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

spdb-1.0.8.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file spdb-1.0.8.tar.gz.

File metadata

  • Download URL: spdb-1.0.8.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for spdb-1.0.8.tar.gz
Algorithm Hash digest
SHA256 9886c7a714633979d5c36c0b7fc6ecf7cf6c0fff8dabcf29a33d9b228b4b4ea0
MD5 5b67098d315650b61461344ca0f6785f
BLAKE2b-256 e59362fc5ce88bf5e31764228ae709b92600b2c796e0b72986df0c8161d6cdb4

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