Skip to main content

Screenshot of code PyPI - Version

A simple Python library with a wordlist for use with hangman featuring easy, medium and hard words!

Usage

First install the package:

$ pip install the-hangman-wordlist

or

$ pip3 install the-hangman-wordlist

Then you could use it like the following example code which generates words endlessly:

from the_hangman_wordlist import HangmanWordlist

if __name__ == "__main__":
    wordlist = HangmanWordlist()

    difficulty = ""
    while difficulty not in {"easy", "medium", "hard", "random"}:
        difficulty = input("What difficulty do you want? (easy/medium/hard/random): ").lower()
        difficulty = {
            "e": "easy",
            "m": "medium",
            "h": "hard",
            "r": "random"
        }.get(difficulty, difficulty)

    script_version, wordlist_version = wordlist.version()
    print(f"Script v{script_version} and wordlist v{wordlist_version}.")

    while True:
        print(f"\n{difficulty.capitalize()} difficulty word: '{wordlist.pull_word(difficulty)}'\n")
        if input("Press Enter to generate a word or type 'exit' to quit... ").lower() == "exit":
            break

Functions

def __init__():
    # Loads when HangmanWordlist is imported, sets the variables and loads the wordlist with the load_wordlist() function.

def fetch_online_wordlist():
    # Fetches the wordlist online and returns it as json.

def load_wordlist():
    # Checks if the user has a copy of the wordlist.json and if it's up to date and then downloads it if necessary with the save_wordlist() function.

def save_wordlist(wordlist):
    # Saves the passed wordlist to wordlist.json

def pull_word(difficulty):
    # Checks if the difficulty passed is a correct option if not it chooses a random difficulty and then it returns a random word from the chosen difficulty.

def version():
    # Simply returns the current script version and wordlist version as a list like this:
    # ('script_version', 'wordlist_version')

Only the pull_word() and version() functions were made to be called by the user the different functions should be called automatically when the script is initialized.

Credits

  • Jurriaaaantje (Wordlist words and update wordlist functionality)
  • TheBiemGamer (Version check, json functionality and library)

Metadata

Release files for the-hangman-wordlist 1.0.5

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

Source distribution (sdist)

Source distribution for the-hangman-wordlist 1.0.5
File Size Uploaded Provenance Actions
the_hangman_wordlist-1.0.5.tar.gz 5.2 kB Without provenance Details for the_hangman_wordlist-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for the-hangman-wordlist 1.0.5
File Interpreter ABI Platform Actions
the_hangman_wordlist-1.0.5-py3-none-any.whl Python 3 none any Details for the_hangman_wordlist-1.0.5-py3-none-any.whl

Total release size: 10.1 kB

Release files / the_hangman_wordlist-1.0.5.tar.gz

Download URL the_hangman_wordlist-1.0.5.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dcf9f9b6fc481ce3d6a2b0db0b723ac3415c2a978016e805a774e9a975c81a3b
BLAKE2b-256 checksum
How to use checksums
582a1751bf2d879f3e3e72829dd7115d910d475b5830dcff01039c4e1a0d911d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / the_hangman_wordlist-1.0.5-py3-none-any.whl

Download URL the_hangman_wordlist-1.0.5-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
159852f73856dcbb1049d165bacfaee5cd022de23269cd38bafe0a6722edf6f2
BLAKE2b-256 checksum
How to use checksums
7f1e33b939d7e93e70402b9e711afb6b680a82f5a6c7c253b8f8bbfdc6237c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Security for the-hangman-wordlist 1.0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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