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.1.tar.gz (8.2 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: really_good_things-0.2.1.tar.gz
  • Upload date:
  • Size: 8.2 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.1.tar.gz
Algorithm Hash digest
SHA256 476f07888d6126b37ac0f776a0a7bb328fe218e71aaecefdff05f4a557b933c5
MD5 4b8c882662cdbeced365a955d9df3bb8
BLAKE2b-256 cb5b6c136974e95a158b3fdd18bb0c712135c9aa60748d802b45cc3326a371b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: really_good_things-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c531dafc4baf032de38d1afec19831d2c0e696d304a4f5badef8d8fba85f42
MD5 f5a66a2d2a9d2b506cafe188430b3bd1
BLAKE2b-256 f9503b790d4dc02ab849f3fee6dcfe038b4df2f9885d9d6bc157b267c865e857

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