Easy way to handle License
Project description
项目License
简介
fast-license 是一个用于项目快速添加License功能的Python包,提供License生成、License更新、中间件等功能。
依赖性
基础依赖(安装fast-license时将自动安装):
- cryptography
额外依赖(根据需求手动安装):
功能 | 依赖 |
---|---|
中间件 | fastapi、starlette |
License更新接口 | fastapi、starlette、pydantic、requests |
安装
# 通过 pip 安装:
pip install fast-license
License生成
1. RSA生成
python -m fast_license generate-keys
2. 私钥输出
python -m fast_license print-key
3. License生成
python -m fast_license generate YYYY-mm-dd_HH:MM:SS
4. 打印License内容
python -m fast_license decrypt
中间件应用
from fast_license.middleware import LicenseMiddleware
app = FastAPI()
app.add_middleware(LicenseMiddleware, license_path={License路径}, private_key={私钥输出内容})
装饰器应用
from fast_license.license import LicenseDecorator
add_license = LicenseDecorator(license_path={License路径}, private_key={私钥输出内容})
@add_license
def func():
pass
License接口
from fast_license.api_manager import APILicense
app = FastAPI()
api_license = APILicense(license_path={License路径}, private_key={私钥输出内容})
# 多机
api_license.register(hosts=[{ip1}, {ip2}], port={服务端口})
app.include_router(api_license.router)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file fast_license-0.1.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 153.8 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e54ca16115dc32c8fc2d1f137631e0d155cab7857a9f9a7677f7f0d1cf46c2c |
|
MD5 | a8ff1badb07bce2b6597b905bd274b8c |
|
BLAKE2b-256 | 026271749c8d0816a3172838d38b19a8aeb90e073966fbc14c5c37d9f0e15708 |
File details
Details for the file fast_license-0.1.1-cp311-cp311-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp311-cp311-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 198.0 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7746b451798304279dab3a8158e1a3c21323eda3e0c31b3606b9a151da4acb9 |
|
MD5 | b4c37e808f4c4fbdd9fa0e050ee9a201 |
|
BLAKE2b-256 | 23778642c2eca97de3af3f664d593fb37afb64c5790e3f131cd0eac31976decf |
File details
Details for the file fast_license-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 154.8 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce98b465a9282b9a0dc4f998f1cb809143f00aceff2939b6def029f01fc98ece |
|
MD5 | 06ccd50b93cfd72efb17562790ed3f05 |
|
BLAKE2b-256 | 80e0834c09a4e348d5000e8e71096de18d8d6853c63e1a0cd10db93680e44ee8 |
File details
Details for the file fast_license-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 167.3 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd387097e18b6406115b5f8477c8091468fc78976fcbd3d018cf6acf04b74e4 |
|
MD5 | 3211648e73fbbb2eb435158dc4f720f7 |
|
BLAKE2b-256 | 6c6696fa66dae4b8ecc5c171a5140b3dbf58e8fe00156ce64a279d3c826c7f77 |
File details
Details for the file fast_license-0.1.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 152.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c91e604a39c6a875c2bdeb2e761ef3aa11289000478205286b1a9df1cb79fb6 |
|
MD5 | ebe964fe135863e2ad113dd901f9d8b4 |
|
BLAKE2b-256 | 2825e5c1399e8cf2a5e85717d2e6f319ceb514dac5a981086e54d02c611298f4 |
File details
Details for the file fast_license-0.1.1-cp310-cp310-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp310-cp310-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 196.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3249fb45f92a229a7e3d053ce7bd30bd4028fd58406a949e09c107b000826d8 |
|
MD5 | 9c3a1530ad165deeef960659304f7b13 |
|
BLAKE2b-256 | 9c4ecd914c43a2c6ab24886551774b47c1dbfa521333057cd08cd60831ce9864 |
File details
Details for the file fast_license-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 154.7 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58721271fdb21ecda1c263d14f3f14ee23e60d210befec73414ed01ae43d7c0f |
|
MD5 | 3ca573025aabd3c126e13f9cd2780874 |
|
BLAKE2b-256 | 47608c64ff0722ec395d795778c84c94ca2e3eba3abc88585e42d57f2669f9f2 |
File details
Details for the file fast_license-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: fast_license-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 167.7 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57bd3bd7557bf18eb97f3456f06477b1767f58c0fd6433184b2d56f8ee9cf093 |
|
MD5 | 4ee3f4b4e8eece735e054cb9d78f1f74 |
|
BLAKE2b-256 | 7dde65e43af0289d7fcb4ddadf3435469340088fc43cce7a66c2599f7c775cca |