Skip to main content

pygenstr

按指定规则生成字符串。

Package version Supported Python versions

特征

  1. 可生成 纯数字
  2. 可生成 纯字母
  3. 可生成 纯数字+纯字母
  4. 可生成 数字与字母混合
  5. 可生成 排除纯数字和纯字母
  6. 可生成 自定义字符
  7. 可生成 自定义字符(排除纯数字和纯字母)
  8. 可生成 自定义字符(纯数字和纯字母)

使用

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

仓库镜像

Release files for genstr 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genstr 0.1.1
File Size Uploaded
genstr-0.1.1.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genstr 0.1.1
File Interpreter ABI Platform
genstr-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / genstr-0.1.1.tar.gz

Download URL genstr-0.1.1.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b00010e6b0a5f10ea921aa95ceb97ca465f891b9a3275cde6c1dbebb2d0c10e5
BLAKE2b-256 checksum
How to use checksums
88456fb8ac99d9d6ef6aafe3f6dcccfe6ab63f8206460986a73fe6dc584265d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / genstr-0.1.1-py3-none-any.whl

Download URL genstr-0.1.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc4ba157e42690310bf706c2c8eefd1ef1575945a6875af23c545642b75ba5d1
BLAKE2b-256 checksum
How to use checksums
55191044192d45c5f3930ae93249d2737163d49c19a81e22996cf163648480b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page