Skip to main content

A tool for generating human-readable, multilingual fantasy character names based on input string hashes.

Project description

Myth Hash

CI Coverage Python Versions License Code style: black Checked with mypy

Myth Hash is a Python package designed to create human-readable hashes that are not only functional but also cognitively engaging. A key feature of this tool is its multilingual support, enabling the generation of hashes in multiple languages. The concept behind these human-readable hashes is to enhance communication and recognition by creating hashes that form vivid, memorable mental images. The goal is to make the hash as human-compatible as possible, ensuring it effectively serves its purpose in an intuitive and user-friendly manner.

Features

  • Character Name Generation: Generates a unique fantasy name based on an input string.
  • Supported Languages: Currently supports English (en) and German (de).
  • CLI Support: Easily generate names via the command line.
  • Library Usage: Integrate Myth Hash into your Python projects.
  • Customizable Data: Modify the included JSON files to customize the generated names.

Requirements

  • Python: 3.11, 3.12, 3.13, 3.14 (including free-threaded 3.14t)
  • Platforms: Linux, macOS, Windows

Installation

You can install Myth Hash using pip:

pip install myth-hash

Usage

Command Line Interface (CLI)

After installing the package, you can use the myth-hash command to generate fantasy names.

Basic Example:

myth-hash "The moon whispered secrets, but only the cats understood." 

Example Output:

exotic-thoughtful-Griffin

Using as a Library

You can also use Myth Hash within your Python code:

Example:

import myth_hash

# Generate a character name using the hash_name function
name_parts = myth_hash.hash_name("The moon whispered secrets, but only the cats understood.", "en")
print(name_parts)  # Output: ('exotic', 'thoughtful', 'Griffin')

# Access individual parts of the name
physical_attr, personality_attr, mystical_character = name_parts
print(f"Physical Attribute: {physical_attr}")
print(f"Personality Trait: {personality_attr}")
print(f"Mystical Character: {mystical_character}")

Performance and Collisions of the Algorithm in Version 0.1.0

In a test with 1,000,000 generated names, the hash_name algorithm produced the following results:

  • Total generated names: 1,000,000
  • Actual duplicates: 119,949
  • Uniqueness rate: 88.01%

What Do These Results Mean?

  • Collisions: The actual number of duplicates (119,949) resulting in a uniqueness rate of 88.01%. This means roughly 12% of the generated names were duplicates.
  • Implications: While the algorithm is robust, users should be aware that with large datasets, the likelihood of name collisions increases.

Future Improvements

  • Improved Uniqueness: Add more attributes and characters to reduce the likelihood of name collisions.
  • Additional Languages: Add support for more languages with help from the community.

Contributing

Contributions are welcome! Please fork the repository, create a new branch for your feature or bug fix, and submit a pull request.

License

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

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

myth_hash-0.2.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

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

myth_hash-0.2.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file myth_hash-0.2.1.tar.gz.

File metadata

  • Download URL: myth_hash-0.2.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Darwin/24.5.0

File hashes

Hashes for myth_hash-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9cb19f869e8b051ee514f325d2b899c6e897bc052b3e1bde7d07775a7bd2bc5a
MD5 1ffea0572f2ffb205aa33d1b737a7b1a
BLAKE2b-256 affe98209bd2b420bd346d912153aa6b352c682309d5eeafe3f26c9a370ec8f5

See more details on using hashes here.

File details

Details for the file myth_hash-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: myth_hash-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Darwin/24.5.0

File hashes

Hashes for myth_hash-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8da0ad155146ba510f2baec58e1437eda89dd56ff8fa8bd68d8ccf27522173c
MD5 a5ae1c179cccb5bd114d12ca0b6ae75f
BLAKE2b-256 bcd984ba8fce1612450ed3aa92f302d419a19e68effa151ff4d62ab343110cbf

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