Skip to main content

Relly Good Things.

Project description

Really Good Things(RGT)

这是一个Python的工具包,封装了一些常用的函数

安装初始化

uv add really-good-things
或
pip install really-good-things

Security模块

from rgt.security import HashUtils,JWTManager,AESECBManager

# Hash加密,比如用于密码储存和验证
password = "password"
hashed = HashUtils.hash(password)
HashUtils.verify(password,hashed)

# 生成和解密JWT
jwt_key = "IbFj9EMYb01U3kSx4R64Pb0Sb60MDkCWLkUEibC821w="
exp_min = 60
jwt_obj = JWTManager(jwt_key,exp_min)
token = jwt_obj.encode(user_id=1234567890)
payload = jwt_obj.decode(token)


# 对称加密,比如 用于存储手机号这类信息,仍需要解密成原文的.
aes_key = "62hQWMlw0uLRC2Iw/ojbtw=="
phone = "13198765432"
aes_ecb_obj = AESECBManager(aes_key)
phone_enc = aes_ecb_obj.encrypt(phone)
phone_dec = aes_ecb_obj.decrypt(phone_enc)

Oauth模块

from rgt.oauth import DingTalkAuth, DingTalkAsyncAuth, FeiShuAuth, FeiShuAsyncAuth
from asyncio import run


# 钉钉同步Oauth认证,
client_id="dingxx......"
client_secret="............."
d = DingTalkAuth(client_id,client_secret)
d.generate_auth_url("http://127.0.0.1:8080")
d.get_user_info("auth_code")

# 钉钉异步Oauth认证
client_id="dingxx......"
client_secret="............."
d = DingTalkAsyncAuth(ding_client_idak,client_secret)
d.generate_auth_url("http://127.0.0.1:8080")
run(d.get_user_info("auth_code"))


# 飞书同步Oauth认证
app_id="cli_xxxx......"
app_secret="............."
d = FeiShuAuth(app_id,app_secret)
d.generate_auth_url("http://127.0.0.1:8080")
d.get_user_info("auth_code")


# 飞书异步Oauth认证
app_id="cli_xxxx......"
app_secret="............."
d = FeiShuAsyncAuth(app_id,app_secret)
d.generate_auth_url("http://127.0.0.1:8080")
run(d.get_user_info("auth_code"))

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

really_good_things-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

really_good_things-0.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file really_good_things-0.2.0.tar.gz.

File metadata

  • Download URL: really_good_things-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for really_good_things-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dfda8aa130e65bb114ec7cdb73b84541d83fbbe0798454a57fadf297fbbfb4d1
MD5 2a1de50596157812af3f39a48450a234
BLAKE2b-256 6a6beabbc8d1ccf8243e9a6ed32a5064e13d9fc045cc845d1437d53a89a4610d

See more details on using hashes here.

File details

Details for the file really_good_things-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: really_good_things-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for really_good_things-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25297feac26bebfd425a518c68d2909f1674d74ec517fa2278b3c40923e682f6
MD5 afbec98aabded143f93971bd63d2d144
BLAKE2b-256 fd07326dd909661b460d437bf136af6ad5cbdc06504c091cc6f86b227c35713d

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