Generate human-readable passcodes with memory optimization
Project description
Readable Passcode
A human-readable passcode generator that creates secure, easy-to-remember passcodes using a combination of common words, numbers, and optional special characters.
Installation
You can install the package via PyPI using pip.
1. Install via PyPI
Run the following command to install the package:
pip install readable-passcode
2. Install from Source
Alternatively, you can install the package from the source code. First, clone the repository:
git clone https://github.com/dedenbangkit/readable-passcode.git
cd readable-passcode
pip install .
Example Usage
1. Using the Python API
You can use the passcode_generator function directly in your Python code to generate human-readable passcodes. Customize the number of words, the length of the random number, and whether or not to include a special character.
from readable_passcode import passcode_generator
# Generate a passcode with 4 words
passcode = passcode_generator(word=4)
print(passcode) # Example output: 'apple-tree-cloud-mountain'
# Generate a passcode with 3 words and a 6-digit number
passcode = passcode_generator(word=3, number=6)
print(passcode) # Example output: 'apple-tree-cloud-123456'
# Generate a passcode with 2 words, a 4-digit number, and a special character
passcode = passcode_generator(word=2, number=4, special_char=True)
print(passcode) # Example output: 'apple-tree-1234$'
2. Using the Command Line Interface (CLI)
You can also generate passcodes directly from the command line. The CLI provides options to specify the number of words, number length, and whether to include a special character.
# Generate a passcode with the default 3 words
$ readable-passcode
apple-tree-cloud
# Generate a passcode with 4 words
$ readable-passcode --word 4
apple-tree-cloud-mountain
# Generate a passcode with 3 words and a 5-digit number
$ readable-passcode --word 3 --number 5
apple-tree-cloud-12345
# Generate a passcode with 2 words, a 4-digit number, and a special character
$ readable-passcode --word 2 --number 4 --special-char
apple-tree-1234$
CLI Options
--word: Specify the number of words in the passcode (default: 3).
--number: Add a random number of a given length at the end.
--special-char: Append a random special character to the passcode.
Key Features
- Efficient Word Retrieval: Optimized for performance, allowing you to retrieve random words without needing to load the entire word list into memory, which is particularly useful for large datasets.
- Command Line Interface (CLI) Support: Easily generate passcodes or retrieve random words directly from your terminal using simple CLI commands, making it convenient for quick use cases.
- Lightweight Package: With a small package size, it ensures minimal overhead and fast installation times, making it suitable for resource-constrained environments or quick setups.
- Customizable Passcode Generation: Supports generating human-readable passcodes with customizable options like word count, number length, and inclusion of special characters.
- Cross-Platform Compatibility: Works seamlessly across different operating systems, including Linux, macOS, and Windows, whether used as a CLI tool or a Python package.
- Extensible: Easy to integrate with other Python applications, making it a flexible tool for developers needing word-based randomization.
- High Performance: Designed for both speed and memory efficiency, ensuring smooth performance even with high word retrieval frequencies or large-scale operations.
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
Built Distribution
File details
Details for the file readable_passcode-1.0.0.tar.gz
.
File metadata
- Download URL: readable_passcode-1.0.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 666e335bb6ea2e3d5582f443975c914005ec61d3e9faa3c1e617b670b4c96254 |
|
MD5 | b5e327263ed89e7e1cac38a8a621c53a |
|
BLAKE2b-256 | beeceed6c940b045bdeb4e6792fc2919ab26c24bd21143589fdad7db58286bd2 |
File details
Details for the file readable_passcode-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: readable_passcode-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0ba642d9a0ebc8751be13191a58a7b5382f3b8439e74fd9ca28e791d24b54d |
|
MD5 | 5d3bc1eabb7370a0b68ac5cd35fdb0ca |
|
BLAKE2b-256 | ce8061c1f107576a6f6bf8e665e9fb189c351e482618778f27dbf6505e480948 |