按指定规则生成字符串。
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 内的数据1~999 |
仓库镜像
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.1.tar.gz
(13.7 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
genstr-0.1.1-py3-none-any.whl
(10.2 kB
view details)
File details
Details for the file genstr-0.1.1.tar.gz.
File metadata
- Download URL: genstr-0.1.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b00010e6b0a5f10ea921aa95ceb97ca465f891b9a3275cde6c1dbebb2d0c10e5
|
|
| MD5 |
bf40a6b6871e31aae0d09d01f52d8633
|
|
| BLAKE2b-256 |
88456fb8ac99d9d6ef6aafe3f6dcccfe6ab63f8206460986a73fe6dc584265d9
|
File details
Details for the file genstr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: genstr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.2 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 |
cc4ba157e42690310bf706c2c8eefd1ef1575945a6875af23c545642b75ba5d1
|
|
| MD5 |
51b22ece73fe31d75ce50b7c99a9bf31
|
|
| BLAKE2b-256 |
55191044192d45c5f3930ae93249d2737163d49c19a81e22996cf163648480b8
|