hangpy-cli


Namehangpy-cli JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/renzofbn/hangpy
SummaryCLI program to play the hangman game suporting multiple languages, ideal for learning new words
upload_time2024-02-20 00:00:11
maintainer
docs_urlNone
authorRenzo Valentin
requires_python>=3.6
license
keywords hangpy hangman game cli command-line hangman-game
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hangpy 🐍

![GitHub](https://img.shields.io/github/license/renzofbn/hangpy) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/renzofbn/hangpy)

Hangman is an engaging Python game that offers a simple yet immersive terminal interface, designed to challenge your vocabulary while providing entertainment.

The primary objective of Hangpy is to provide an enjoyable gaming experience while challenging players to guess words within a limited number of attempts.

The game is available in English and Spanish and available for Linux, Windows, MacOS, and any other platform that supports Python 3. 


![Preview Gif](https://raw.githubusercontent.com/Renzofbn/hang-py/main/preview.gif)

# Installation:

Get started by installing the game through pip:

```
pip install hangpy-cli
```

> Ensure that your $PATH includes the ~/.local/bin directory to enable your shell to locate the hangpy command seamlessly.


# Usage:

Initiate the game by entering:
```
hangpy
```

You can customize the word language or adjust the menu language by executing:
```
hangpy -c
```

Explore the top 5 scores by typing:
```
hangpy -t
```

For additional guidance, refer to the help message:
```
hangpy -h
```

# Features:
- Language Support:

    Hangpy offers both English and Spanish language support, allowing players to enjoy the game in their preferred language. Whether you want to be fluent in English or Spanish.

- Extensive Word Libraries:

    Hangpy includes a comprehensive word database comprising over 6,000 words in Spanish and 1,000 words in English. This extensive word collection ensures a diverse and challenging gaming experience, with a wide range of words for players to guess and explore.

- Enhanced Interface: 

    Hangpy features a new and improved interface, designed to provide a visually appealing and intuitive gaming environment with a colorful display.

- Score Tracking:

    Hangpy records the top 5 highest scores achieved by players, adding a competitive element to the game.

# Project Structure
> *.py files are well documented, if you want to learn more about how the game works, you could read the source files
## main.py
The main.py file serves as the entry point for the Hangpy game. With the `run()` function, it initializes the game and handles command-line arguments to customize the game's language settings and display the top scores.

## game.py
The `game.py` file is the core script of the Hangpy game. It contains the main logic and functionality required to run the game. Here's an overview of what this file includes:

- Word Selection:
    
    Hangpy randomly selects words from a predefined list, which serves as the basis for the game. These words are the ones that players attempt to guess letter by letter.

- Game Loop:
    
    The script implements a game loop that allows players to make guesses until run out of attempts or want to exit. It manages player input, validates guesses, updates the display, and tracks game progress.

- Scoring System:
    
    Hangpy records player scores and displays the top 5 scores at the end of each game. This adds a competitive element to the game, motivating players to improve their performance.

## utils.py
The `utils.py` file contains utility functions and configurations essential for the operation of Hangpy.

- CONFIG Global Variable:

    Is an instance of ConfigParser that loads the contents of the `config.ini` file upon module import. If the configuration file does not exist or is empty, the script invokes the `gen_config()` function to create a new configuration file with default settings.

    Also the config path could be found in `hangpy_config`. 

- File Initialization:

    The initialization process ensures that the game has access to necessary configurations from the config.ini file, setting up default values for game settings and player profiles if none are found.

- clear()
    
    To clear the terminal when needed :D

## translations.py
English and Spanish translations for every sentence used, under the `gm` variable.

## ascii_status
All the ascii art that the game uses, and functions to print them when needed.

## hangpy-cli Package
The hangpy-cli package facilitates the installation and execution of the Hangpy game through pip. It includes configuration files and metadata necessary for package management and distribution.


# Design Choices
## Terminal Interface
The decision to implement a terminal interface was driven by simplicity and accessibility. By using the terminal, Hangpy can run on various platforms without requiring additional dependencies or graphical libraries. This design choice ensures that users can enjoy the game without any installation hurdles or compatibility issues.

## Modular Code Structure
The project's code is organized into separate files and functions to promote modularity and maintainability. Each file encapsulates specific functionality, making it easier to understand, debug, and extend the codebase.

## User-Friendly Features
Hangpy includes features such as language customization and score tracking to enhance the user experience. Players can switch between different word languages and menu languages to cater to their preferences. Moreover, the scoring system adds a competitive element to the game, encouraging players to strive for higher scores while enjoying the game and most importantly, learning new words.



# License

Hangpy operates under the MIT License. For further details, please refer to the [LICENSE](https://github.com/renzofbn/hangpy/blob/main/LICENSE) file.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/renzofbn/hangpy",
    "name": "hangpy-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "hangpy,hangman,game,cli,command-line,hangman-game",
    "author": "Renzo Valentin",
    "author_email": "renzofbn@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/70/ca/92ac35fe903d12c5c53937cefc25ed4fceec93074350aef81789a85578a0/hangpy-cli-0.1.3.tar.gz",
    "platform": null,
    "description": "# Hangpy \ud83d\udc0d\n\n![GitHub](https://img.shields.io/github/license/renzofbn/hangpy) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/renzofbn/hangpy)\n\nHangman is an engaging Python game that offers a simple yet immersive terminal interface, designed to challenge your vocabulary while providing entertainment.\n\nThe primary objective of Hangpy is to provide an enjoyable gaming experience while challenging players to guess words within a limited number of attempts.\n\nThe game is available in English and Spanish and available for Linux, Windows, MacOS, and any other platform that supports Python 3. \n\n\n![Preview Gif](https://raw.githubusercontent.com/Renzofbn/hang-py/main/preview.gif)\n\n# Installation:\n\nGet started by installing the game through pip:\n\n```\npip install hangpy-cli\n```\n\n> Ensure that your $PATH includes the ~/.local/bin directory to enable your shell to locate the hangpy command seamlessly.\n\n\n# Usage:\n\nInitiate the game by entering:\n```\nhangpy\n```\n\nYou can customize the word language or adjust the menu language by executing:\n```\nhangpy -c\n```\n\nExplore the top 5 scores by typing:\n```\nhangpy -t\n```\n\nFor additional guidance, refer to the help message:\n```\nhangpy -h\n```\n\n# Features:\n- Language Support:\n\n    Hangpy offers both English and Spanish language support, allowing players to enjoy the game in their preferred language. Whether you want to be fluent in English or Spanish.\n\n- Extensive Word Libraries:\n\n    Hangpy includes a comprehensive word database comprising over 6,000 words in Spanish and 1,000 words in English. This extensive word collection ensures a diverse and challenging gaming experience, with a wide range of words for players to guess and explore.\n\n- Enhanced Interface: \n\n    Hangpy features a new and improved interface, designed to provide a visually appealing and intuitive gaming environment with a colorful display.\n\n- Score Tracking:\n\n    Hangpy records the top 5 highest scores achieved by players, adding a competitive element to the game.\n\n# Project Structure\n> *.py files are well documented, if you want to learn more about how the game works, you could read the source files\n## main.py\nThe main.py file serves as the entry point for the Hangpy game. With the `run()` function, it initializes the game and handles command-line arguments to customize the game's language settings and display the top scores.\n\n## game.py\nThe `game.py` file is the core script of the Hangpy game. It contains the main logic and functionality required to run the game. Here's an overview of what this file includes:\n\n- Word Selection:\n    \n    Hangpy randomly selects words from a predefined list, which serves as the basis for the game. These words are the ones that players attempt to guess letter by letter.\n\n- Game Loop:\n    \n    The script implements a game loop that allows players to make guesses until run out of attempts or want to exit. It manages player input, validates guesses, updates the display, and tracks game progress.\n\n- Scoring System:\n    \n    Hangpy records player scores and displays the top 5 scores at the end of each game. This adds a competitive element to the game, motivating players to improve their performance.\n\n## utils.py\nThe `utils.py` file contains utility functions and configurations essential for the operation of Hangpy.\n\n- CONFIG Global Variable:\n\n    Is an instance of ConfigParser that loads the contents of the `config.ini` file upon module import. If the configuration file does not exist or is empty, the script invokes the `gen_config()` function to create a new configuration file with default settings.\n\n    Also the config path could be found in `hangpy_config`. \n\n- File Initialization:\n\n    The initialization process ensures that the game has access to necessary configurations from the config.ini file, setting up default values for game settings and player profiles if none are found.\n\n- clear()\n    \n    To clear the terminal when needed :D\n\n## translations.py\nEnglish and Spanish translations for every sentence used, under the `gm` variable.\n\n## ascii_status\nAll the ascii art that the game uses, and functions to print them when needed.\n\n## hangpy-cli Package\nThe hangpy-cli package facilitates the installation and execution of the Hangpy game through pip. It includes configuration files and metadata necessary for package management and distribution.\n\n\n# Design Choices\n## Terminal Interface\nThe decision to implement a terminal interface was driven by simplicity and accessibility. By using the terminal, Hangpy can run on various platforms without requiring additional dependencies or graphical libraries. This design choice ensures that users can enjoy the game without any installation hurdles or compatibility issues.\n\n## Modular Code Structure\nThe project's code is organized into separate files and functions to promote modularity and maintainability. Each file encapsulates specific functionality, making it easier to understand, debug, and extend the codebase.\n\n## User-Friendly Features\nHangpy includes features such as language customization and score tracking to enhance the user experience. Players can switch between different word languages and menu languages to cater to their preferences. Moreover, the scoring system adds a competitive element to the game, encouraging players to strive for higher scores while enjoying the game and most importantly, learning new words.\n\n\n\n# License\n\nHangpy operates under the MIT License. For further details, please refer to the [LICENSE](https://github.com/renzofbn/hangpy/blob/main/LICENSE) file.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "CLI program to play the hangman game suporting multiple languages, ideal for learning new words",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/renzofbn/hangpy"
    },
    "split_keywords": [
        "hangpy",
        "hangman",
        "game",
        "cli",
        "command-line",
        "hangman-game"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9f2344aca96cd33be8393579a603fa83164f8fb6413c9cce1eba1d5f8e783b0",
                "md5": "c074ebda141bf3aefa4e31344bc50158",
                "sha256": "e1650b45a78b993d82d17af90576326e578807665b728e079abe5c3f492c12ab"
            },
            "downloads": -1,
            "filename": "hangpy_cli-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c074ebda141bf3aefa4e31344bc50158",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 35210,
            "upload_time": "2024-02-20T00:00:09",
            "upload_time_iso_8601": "2024-02-20T00:00:09.461272Z",
            "url": "https://files.pythonhosted.org/packages/c9/f2/344aca96cd33be8393579a603fa83164f8fb6413c9cce1eba1d5f8e783b0/hangpy_cli-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70ca92ac35fe903d12c5c53937cefc25ed4fceec93074350aef81789a85578a0",
                "md5": "c7c28625d1617ea9645ad1a8b6236c38",
                "sha256": "46473adddcbc292f341ed5b0e11fdee3d66d000f7f61b2bdca86d5e3ba49c0b9"
            },
            "downloads": -1,
            "filename": "hangpy-cli-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c7c28625d1617ea9645ad1a8b6236c38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 37774,
            "upload_time": "2024-02-20T00:00:11",
            "upload_time_iso_8601": "2024-02-20T00:00:11.004310Z",
            "url": "https://files.pythonhosted.org/packages/70/ca/92ac35fe903d12c5c53937cefc25ed4fceec93074350aef81789a85578a0/hangpy-cli-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 00:00:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "renzofbn",
    "github_project": "hangpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hangpy-cli"
}
        
Elapsed time: 0.19175s