Skip to main content

A simple and secure password generator for Python

Project description

passginity — Secure Password Generator

A simple and secure password generator for Python. Supports custom character sets, exclusion of ambiguous characters, and cryptographically strong randomness.

Features:

  • Uses secrets module — cryptographically secure
  • Enable/disable letters, digits, and symbols
  • Option to exclude confusing characters: 0/O, 1/I/l
  • Clean and intuitive API

Installation

pip install passginity

Quick Start

from passginity import pass_generate

# Generate a 12-character password
password = pass_generate()
print(password)  # e.g., Kx9$mRt7qW#p

# Exclude ambiguous characters (safe for manual input)
password = pass_generate(exclude_ambiguous=True)
print(password)  # e.g., Hb8n$Ef6vX!s

# Letters and digits only (no symbols)
password = pass_generate(sym_alp=False)
print(password)  # e.g., mK9xRt7qWp2n

Function: pass_generate

pass_generate(
    length: int = 12,
    eng_alp: bool = True,
    num_alp: bool = True,
    sym_alp: bool = True,
    exclude_ambiguous: bool = False
) -> str

Parameters:

  • length — password length (default: 12)
  • eng_alp — include Latin letters (a-z, A-Z)
  • num_alp — include digits (0-9)
  • sym_alp — include special symbols (!@#$%^&*...)
  • exclude_ambiguous — exclude easily confused characters: 0, O, 1, I, l

Returns:

  • A randomly generated password as a string.

Raises:

  • ValueError — if length < 1 or all character sets are disabled.

License

MIT — free to use in personal and commercial projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passginity-1.0.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passginity-1.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file passginity-1.0.0.tar.gz.

File metadata

  • Download URL: passginity-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for passginity-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7652aae5a7c21a642613accf0db340088e88d715765665df5591c5ac101a11cd
MD5 afbe8ffedaa4fa1d656c5d7d457245b4
BLAKE2b-256 023cf5fdcb1cb444bcc06409b64b19c6f0943c6718d76c4eafd0541956a93797

See more details on using hashes here.

File details

Details for the file passginity-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: passginity-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for passginity-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b614008cb4ad800793c28b88dacd3f6e943eb77495a4db5d795ef782b54341e
MD5 71961d347401cddbf6f075194df51b02
BLAKE2b-256 d542c700caf17a436e0c4c8f5892dae6f776792d26b4ef1ea4b78038eb090ef2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page