Skip to main content

ppgen

一个基于汉语拼音的密码/密码短语生成器。它可以生成易记的强密码,同时提供中文记忆提示。

特性

  • 支持两种密码生成模式:
    • 复杂密码:使用拼音组合,并添加特殊字符和数字
    • 密码短语:使用多个拼音词组,通过连字符连接
  • 为每个生成的密码提供中文和拼音的记忆提示
  • 支持密码强度评估
  • 支持文本和JSON输出格式
  • 可配置参数:最小长度、词数量、生成数量等

安装

pip install ppgen

使用方法

基本用法

生成密码短语(默认模式):

ppgen

生成复杂密码:

ppgen --password

常用选项

  • -p, --password: 生成复杂密码而不是密码短语
  • -c, --count: 生成密码的数量(默认:5)
  • -l, --min_length: 密码最小长度(默认:12)
  • -w, --word_count: 密码短语模式下使用的拼音词数量(默认:4)
  • -o, --output: 输出格式,可选 text 或 json(默认:text)

示例

生成3个密码短语:

ppgen -c 3

生成最小长度为15的复杂密码:

ppgen -p -l 15

使用5个词生成密码短语:

ppgen -w 5

JSON格式输出:

ppgen -o json

输出示例

文本格式输出:

密码: zhongwen-yuyan-jisuanji-ruanjian
强度: 4
记忆提示: 中文(zhongwen)-语言(yuyan)-计算机(jisuanji)-软件(ruanjian)
---

JSON格式输出:

[
  {
    "password": "zhongwen-yuyan-jisuanji-ruanjian",
    "strength": 4,
    "hints": "中文(zhongwen)-语言(yuyan)-计算机(jisuanji)-软件(ruanjian)"
  }
]

Metadata

Release files for ppgen 0.3.2

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

Source distribution (sdist)

Source distribution for ppgen 0.3.2
File Size Uploaded
ppgen-0.3.2.tar.gz 605.2 kB Details

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / ppgen-0.3.2.tar.gz

Download URL ppgen-0.3.2.tar.gz
Size 605.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9799ea5135222df2594e083a6fdac31ab418166f9054982f4ad641a5f3ea297f
BLAKE2b-256 checksum
How to use checksums
075b6cff1b9929d921362b921f79d2e6f73d9dd78258b094bca1c975fe1413a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release files / ppgen-0.3.2-py3-none-any.whl

Download URL ppgen-0.3.2-py3-none-any.whl
Size 603.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266db77682119f5ab8dcf696c3763f06560800c1ae0fcdd4bb46cba15edc0b91
BLAKE2b-256 checksum
How to use checksums
a9b85a37b52e730443204b4bf038ce875fc7c265e41bd13941b75b5f39132aa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.0

2 release files

0.2.0

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