Skip to main content

Really 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.7.tar.gz (8.8 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.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: really_good_things-0.2.7.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","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.7.tar.gz
Algorithm Hash digest
SHA256 d53ef7589383a87bcf987253b7a88c2293fe5948157b0c806ddb7b969c18161d
MD5 9753e390223e971e5a663e08567e59d9
BLAKE2b-256 cc931ea2c06bfbc5ccd0796dbef921492dca73479c3af991189f96dbe6558d0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: really_good_things-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 918d5662f7ac0758407b6f64890c5c1109ef7d04e78ccff053f49dac1b5a6caa
MD5 dd73f38924c4df6f27c27a195d17afeb
BLAKE2b-256 a21e1c5e4735f036453866d43b290d34e930429de95d010fc98a85a58a04df1f

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