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

装饰器应用

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


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

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

fast_license-0.1.2-cp311-cp311-win_amd64.whl (154.2 kB view details)

Uploaded CPython 3.11Windows x86-64

fast_license-0.1.2-cp311-cp311-manylinux_2_17_x86_64.whl (199.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

fast_license-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (155.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fast_license-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (168.2 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

fast_license-0.1.2-cp310-cp310-win_amd64.whl (153.1 kB view details)

Uploaded CPython 3.10Windows x86-64

fast_license-0.1.2-cp310-cp310-manylinux_2_17_x86_64.whl (197.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

fast_license-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (155.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fast_license-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (168.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a12e06f8077516d17aebaf765f262de6c48a48b03eaba6a1e55d7a64e2b76070
MD5 07a95d9b7f833cd956eeb0737afcaaf8
BLAKE2b-256 5ee863561b5628f7b0961a727dc8b3a8e63d06f956c9774f31645c463c49a32d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9d9b949d634bd2644f6aaa49a0d9730207922f90eee4b6a06491ce2c0ba7b15a
MD5 4195f95ade50d0a938dd1d776ef7a86e
BLAKE2b-256 e073d32d2eadb0990e7598cf76a505b571331357462a90929838f928582cb886

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd0ec51525a952213f1d838f4577ac4b3d9b2f6b636fcb3a6b8f1b4286af68d6
MD5 babb1d51ee8d7f6421a0137eab949da4
BLAKE2b-256 bc42a94f4965fe3504b4dc7ef3b4fa01c1110542960890db2578b94f761a4fd2

See more details on using hashes here.

File details

Details for the file fast_license-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for fast_license-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b46572a4627b925db0c042c64c2e56e87ae72a0f0dd34c213576b378d6aa7620
MD5 d30918992e874c8f2f3ad88fd0e32b97
BLAKE2b-256 ad13448d4eb9f6dae045b2561cb2690d1af97d4bece05ade2f25dab43c8790bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9998aeac8e03d50c6d9725d559db7833ac1b68b9bc3395246c9de93845c418b7
MD5 3814f573e686db04af497dadd600a04d
BLAKE2b-256 d922a6b2f75c0b2487bcef9f108c7166ba2986a61f31f1b6e064f9da3a9cc0b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 eadc52b0e592fd3959c8de6bed1e550813e124ef73f31c209efc865f7d3842b1
MD5 f2e5a5a04b172b39a38eea30d707b5eb
BLAKE2b-256 a2bb516c4f6e3333dd9436bd736b83b54a44711704c530b4334a3e3c51cf7a1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 345cd4991186c5ea3f1478cc6eb72680dc2adffdbd657b060948befc8a9e862d
MD5 86bf7f8aff25a4aeec3192ad0f79f439
BLAKE2b-256 a60e4768f477bcb5d4e29a7df9cb35dabea6b92fd732d1b5d2d44c60ee161f80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_license-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 724c6dbab1fd45be5b1d5ea04c1ae3dc17352ede799a044e6f05d3ff489487fc
MD5 fa06baaf6027987418ce7bd1e62d112a
BLAKE2b-256 73b81a1e145c417571a35a24578ba5c835f79e9395c96b6a7e1c3b48326ecf70

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