Skip to main content

GenerateKey

GenerateKey is a simple Python tool designed to generate secure secret keys and user passwords. It can be used both as a command-line utility and as a library within other Python projects.

Features

• Secret Key Generation: Create URL-safe base64-encoded secret keys of customizable byte length, suitable for cryptographic purposes such as signing tokens or encrypting data. • User Password Generation: Generate random user passwords of customizable length, including uppercase and lowercase letters, digits, and punctuation symbols.

Installation

You can install GenerateKey using pip:

pip install generatekey

Usage

Command-Line Interface

GenerateKey provides a CLI for generating keys and passwords directly from the terminal.

• Display Help To see the available commands and options, run:

generatekey -h

• Generate a Secret Key with Default Settings (64 bytes)

generatekey secretkey

• Generate a Secret Key with a Specific Number of Bytes

generatekey secretkey --nbyte 32

• Generate a User Password with Default Length (12 characters)

generatekey userpass

• Generate a User Password with a Specific Length

generatekey userpass --length 16

As a Python Module

You can also import GenerateKey into your Python projects:

from generatekey import get_secret_key, generate_user_password

# Generate a secret key of 32 bytes
secret_key = get_secret_key(nbytes=32)
print(f"Secret Key: {secret_key}")

# Generate a user password of length 16
password = generate_user_password(length=16)
print(f"User Password: {password}")

Requirements

• Python 3.10 or higher

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with descriptive commit messages.
  4. Push your branch to your forked repository.
  5. Create a pull request to the main repository.

Before submitting, ensure that:

• All tests pass. • Your code follows the project’s coding style. • You have updated the documentation if necessary.

License

This project is licensed under the MIT License. See the [LICENSE file for details.

Acknowledgments

• Thanks to the contributors of open-source libraries used in this project. • Inspired by the need for simple and secure key and password generation tools.

Support

If you encounter any issues or have questions, feel free to open an issue on the GitHub [repository.

Changelog

Version 0.1.0

• Initial release • Command-line interface for generating secret keys and user passwords • Functions available for import into other Python projects • Unit tests covering main functionalities

Feel free to modify this README to better suit your project’s specifics, such as updating URLs, adding badges, or including additional sections like a table of contents or FAQs.

Metadata

Release files for generatekey 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 generatekey 0.1.1
File Size Uploaded
generatekey-0.1.1.tar.gz 3.9 kB Details

Built distribution (wheel)

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

Total release size: 8.8 kB

Release files / generatekey-0.1.1.tar.gz

Download URL generatekey-0.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ef9ecf5fab32f660a356bbb1ea77031847c36d4122bfd9b4b9b05760a045767b
BLAKE2b-256 checksum
How to use checksums
deb214f2f8cac96fd4742d6bfb4ee4e92409a5b81cb69172e2a173d0ab396047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

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

Download URL generatekey-0.1.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aca5da1307d00915e0d598000a7e51b1e1985c8fa4416aed53aa7cc14a3b6003
BLAKE2b-256 checksum
How to use checksums
3bf5133130afcadd3282f266090c64de51c68f657e52574b68ff8af1c5c7956b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

0.1.1 This release

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