Skip to main content

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={私钥输出内容})

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

fast_license-0.1.0-cp311-cp311-win_amd64.whl (134.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

fast_license-0.1.0-cp311-cp311-manylinux_2_17_x86_64.whl (173.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fast_license-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (134.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fast_license-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl (143.2 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

fast_license-0.1.0-cp310-cp310-win_amd64.whl (133.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

fast_license-0.1.0-cp310-cp310-manylinux_2_17_x86_64.whl (171.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fast_license-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (134.5 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fast_license-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl (142.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file fast_license-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eacccdb2758ea62d2dedf3b0c8c6dbbf736a716525a194b90b09686bd44005ef
MD5 9d91b9ac7ae9b67c866aab4dd2bcab69
BLAKE2b-256 d5c31a06d255bcbe72e30c78bc40d7bf63b396c687ffa7a8b79c13906521d5cf

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 042d5dc87cf216512f67060befb69160c60455d1136ee316626bd620bf9eda6f
MD5 01e86883b651248d98f4e8ffa8474a78
BLAKE2b-256 fa6857e03b7a3c06a96af7c165a27b49b4b26117d3a4a30a965d33d1dbca93c8

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c413f31aa5ab663c62417631a52d37dd7af91539117ae6c17708acf522bdf919
MD5 b4e6fc91ecf914ea85bcd09f75b1adf7
BLAKE2b-256 89bc0b475bd145b50d73a07bff3266eb8d87554e6e1bb6f0d4104f67b64b4503

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0cf02b931e7d8c950862f7534a098faa5cd1f3c2707a6d7a497edef25be10657
MD5 d6306a5622ffbb5ab46b52c0afd8e334
BLAKE2b-256 81b0d52e6ea2fec80a50038e85e3cdd7da4d487068c9a23eac0ca516477bf73e

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ce6a45b01236d7dd909c554bca41dba5324f988cc557ed686e935ec1a9da8cb5
MD5 01840308f2c95ae03462d179f20eb7cf
BLAKE2b-256 b43887c6de73320ed80cfe6118b75173d7d72d274b5390b6706aec92a312d68e

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e890673eff764fb7c851ecb4ced60ec53958caf1ef88b2c2af8681844f18f1da
MD5 caa5398b203f732f3bd54ea50d780ef7
BLAKE2b-256 4c4cbb388cb0075f078201683a8d200ff7412d353d773ee15fcd49e6f3257d13

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b924cace0ca103a8867be77ceb2d3c412b1135b50c92a36a546cd46793fb95d
MD5 dfeb9174dd258910b772f6bca062a989
BLAKE2b-256 1054f2f76face96f73b89d48e55d067b26efe877ba7e7e5d00672590e6c2f287

See more details on using hashes here.

File details

Details for the file fast_license-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3a27c67976702a91b0cb4540e79035673d938423b274247e0b7f0696bfab94e9
MD5 03f2edad4668c92e9ef82976807f542a
BLAKE2b-256 fd5fdf6d2075b5a1506a5bbf4317dcde8dd669b65107f9c405f1af571b88f6fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page