DisnanaLG
ライセンスキーを生成するためのPythonモジュールです。ランダム性を持たせたライセンスキーの生成が可能で、カスタマイズオプションも豊富に用意されています。
特徴
ランダムな長さの部分を持つライセンスキーの生成
セパレーターのカスタマイズ
総文字数やセパレーターの数を指定可能
インストール方法
このパッケージはPyPIに登録されています。以下のコマンドでインストールできます。
pip install DisnanaLG
使用方法
基本的な使用方法の例を以下に示します。
import DisnanaLG
# デフォルトのライセンスキーを生成
print(DisnanaLG.license_key())
# カスタマイズされたライセンスキーを生成
print(DisnanaLG.license_key_v2(min_part_length=4, max_part_length=8, num_parts=4, separator='-', total_length=25))
print(DisnanaLG.license_key_v2(min_part_length=4, max_part_length=8, total_separators=3))
オプション設定
license_key_v2 関数は以下のパラメータを受け取ります。
min_part_length (int): 各部分の最小長さを指定します。デフォルトは3です。
max_part_length (int): 各部分の最大長さを指定します。デフォルトは6です。
num_parts (int): ライセンスキーの部分の数を指定します。デフォルトは6です。
separator (str): 部分間のセパレーターを指定します。デフォルトは ‘-’ です。
total_length (int): ライセンスキーの総文字数を指定します。デフォルトは None(指定なし)です。
total_separators (int): ライセンスキーのセパレーターの数を指定します。デフォルトは None(指定なし)です。このオプションを指定すると、num_parts は total_separators + 1 に設定されます。
戻り値
str: 生成されたライセンスキーを返します。
例
以下に具体的な使用例を示します。
import DisnanaLG
# デフォルトのライセンスキーを生成
print(DisnanaLG.license_key())
# 出力例: 'A1B-C2D-E3F-G4H-I5J-K6L'
# カスタマイズされたライセンスキーを生成
print(DisnanaLG.license_key_v2(min_part_length=4, max_part_length=8, num_parts=4, separator='-', total_length=25))
# 出力例: 'A1B2-C3D4-E5F6-G7H8-1234'
# セパレーターの数で指定したライセンスキーを生成
print(DisnanaLG.license_key_v2(min_part_length=4, max_part_length=8, total_separators=3))
# 出力例: 'A1B2-C3D4-E5F6-G7H8'
ライセンス
このプロジェクトはBSD 3-Clauseライセンスの下で公開されています。詳細については、LICENSE ファイルを参照してください。
Metadata
Release files for DisnanaLG 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| disnanalg-1.0.7.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| DisnanaLG-1.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / disnanalg-1.0.7.tar.gz
| Download URL | disnanalg-1.0.7.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad978c5d0bf9ed5c2128ae084dd141ade995e11c6359f82c1fd61c900dc67abd
|
|
BLAKE2b-256 checksum How to use checksums |
fcbd66633d08227f90af91aab3188348ec21061e1d92fc53bd6a61b8d4a22844
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / DisnanaLG-1.0.7-py3-none-any.whl
| Download URL | DisnanaLG-1.0.7-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
880de58052fd0ac83820c3b7849fe40dfc8deb4b5ecf4bf63e7c0a4ce2c0d1d7
|
|
BLAKE2b-256 checksum How to use checksums |
f1cf386044047cd819556164bb2e859a490709d2ade422b1ced9648e1cb322ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for DisnanaLG 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.