按指定规则生成字符串。
Project description
pygenstr
按指定规则生成字符串。
特征
- 可生成 纯数字
- 可生成 纯字母、
- 可生成 纯数字+纯字母
- 可生成 数字与字母混合
- 可生成 排除纯数字和纯字母
- 可生成 自定义字符
- 可生成 自定义字符(排除纯数字和纯字母)
- 可生成 自定义字符(纯数字和纯字母)
使用
from genstr import Genstr
from genstr import Mode
list = Genstr(
length: int,
mode: Mode = Mode.PURE_NUMBERS,
alphabets: str = '',
prefix: str = '',
suffix: str = '',
is_range: bool = False
).combine().list()
print(type(list), list)
<class 'list'>
[]
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
length |
int | 无 | 组合长度 |
mode |
Mode(枚举) |
Mode.PURE_NUMBERS | 域名组合模式: 1. 纯数字 2. 纯字母 3. 纯数字+纯字母 4. 数字与字母混合 5. 排除纯数字和纯字母 6. 自定义字符 7. 自定义字符(排除纯数字和纯字母) 8. 自定义字符(纯数字和纯字母) |
alphabets |
str | 空 | 自定义组合字母表,mode 6/7/8 必填 |
prefix |
str | 空 | 组合前缀,如 -P a,则生成 a* |
suffix |
str | 空 | 组合后缀,如 -S z,则生成 *z |
is_range |
bool | False | 范围,如长度为 3 时,则范围为 1-3 内的数据 |
仓库镜像
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 Distribution
genstr-0.1.0.tar.gz
(10.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genstr-0.1.0.tar.gz.
File metadata
- Download URL: genstr-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50d52d8e4d3c5246fd94564a7ad2fca5fb38db90dcb764201df5818bdb91e054
|
|
| MD5 |
3fc8db2e0b00be7f6216355665ee216b
|
|
| BLAKE2b-256 |
064654cee10a327d721d469cb82cb4b06ee27c7074015169ae7f3a685ef91ed9
|
File details
Details for the file genstr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: genstr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eafd9fbe6c8b6997f7cf610a3016fb1f5ca3789b489cb2bc7cf595a221f6394e
|
|
| MD5 |
96f43840c6b82951da815237b47ca7db
|
|
| BLAKE2b-256 |
82af34b18b3a2d44611efff61dad713c168261168b85cda2bb01f4379bcacbf7
|