{"id":19692983,"url":"https://github.com/magnetrwn/nethang","last_synced_at":"2026-05-26T16:34:18.607Z","repository":{"id":155281602,"uuid":"628596957","full_name":"magnetrwn/NetHang","owner":"magnetrwn","description":"Compact server library to manage multiplayer lobbies for most terminal games, even as barebones as netcat clients.","archived":false,"fork":false,"pushed_at":"2023-12-15T20:56:45.000Z","size":9516,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T09:10:45.675Z","etag":null,"topics":["collaborate","command-line-interface","game","multiprocessing","netcat","python","python-package","server","setuptools","sockets","wheel"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magnetrwn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-16T12:59:50.000Z","updated_at":"2023-11-16T15:45:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4ff9e1f-cbde-4437-aec4-c92562b77000","html_url":"https://github.com/magnetrwn/NetHang","commit_stats":{"total_commits":112,"total_committers":4,"mean_commits":28.0,"dds":0.4464285714285714,"last_synced_commit":"951991d8630ae2a7d539820e894783d559e91dbe"},"previous_names":["magnetrwn/nc-hangman"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2FNetHang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2FNetHang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2FNetHang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2FNetHang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnetrwn","download_url":"https://codeload.github.com/magnetrwn/NetHang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241001912,"owners_count":19892074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborate","command-line-interface","game","multiprocessing","netcat","python","python-package","server","setuptools","sockets","wheel"],"created_at":"2024-11-11T19:14:57.155Z","updated_at":"2026-05-26T16:34:18.562Z","avatar_url":"https://github.com/magnetrwn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetHang\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000)](https://github.com/psf/black)\n[![CodeFactor](https://www.codefactor.io/repository/github/magnetrwn/NetHang/badge)](https://www.codefactor.io/repository/github/magnetrwn/NetHang)\n[![Coverage Status](https://coveralls.io/repos/github/magnetrwn/NetHang/badge?branch=main)](https://coveralls.io/github/magnetrwn/NetHang?branch=main)\n\n**Note:** This was my Python project to get up to speed with the language and especially `setuptools`, `multiprocessing` and `socket`. It's development quality, not good as a library. Suggested use is only as educational material.\n\nCompact server library to manage multiplayer lobbies for games, even as barebones as netcat clients, using only standard Python packages. There are sample implementations of games in the `NetHang/examples` folder, which can be useful to demonstrate what the library automates. The demo shows a sample implementation of a game of hangman, which is located in the examples folder.\n\nCheck out the `NetHang/examples` [README](NetHang/examples/README.md) and the `NetHang/config` [README](NetHang/config/README.md).\n\n## WebM Demo (Large)\n\n![WebM Demo](demo.gif)\n\n## Installation\n\nYou have two options for installation:\n\n+ **Download the Wheel**: Grab the pre-built wheel file (`NetHang-\u003cversion\u003e-py3-none-any.whl`) from the latest release.\n+ **Manual Installation**: Run `make install` from the command line to install the application yourself.\n\n## Requirements\n\nTo use NetHang and generate the installation wheel, you need to have the following requirements installed:\n\n+ `build`\n+ `setuptools`\n\nIf you download the pre-built wheel, **you don't need to install** these setup libraries.\n\nAdditionally, the following requirements are set for developing NetHang, specifically for linting, formatting, and testing the package before merging pull requests:\n\n+ Requirements are explicitly stated in the [requirements.txt](requirements.txt) file.\n+ The project uses Trunk Check (VSCode extension) for consistent code checking across multiple developer platforms.\n\n## Usage\n\nOnce installed, follow these steps to start the server:\n\n+ Open a terminal or command prompt.\n+ Run `NetHang` or `nethang` to start the server.\n\nMake sure to check the configuration file `config/settings.json`, which is bundled with NetHang in Python's site-packages directory when installed. This file allows you to configure the server behavior when running from the shell or loading defaults for each run of NetHangServer.\n\nYou can also use the NetHang package as a module to further customize its usage, or have multiple servers at once. Here's an example:\n\n```python\nfrom NetHang.server import NetHangServer\n\nserver = NetHangServer(\"localhost\")\nserver.run()\n\n# Runs in background processes, not blocking\n\nserver.stop()\nexit()\n```\n\nThis usage will start the server with `examples/hangman.py` as the default game class to run (a sample multiplayer game of hangman using netcat), but this should be set to what you want your game class to be using the `game_class` parameter:\n\n```python\nserver = NetHangServer(\"localhost\", game_class=MyGame)\n```\n\nYour game class needs to have a `game_data` dict defined for graphics to be sent to users while joining. Please check `examples/hangman.py` implementation.\n\n**Note:** At the moment, logging is not present and basic print statements are used instead. Logging support will be added soon.\n\n## Contributing\n\nFeel free to send your own suggestions or PRs if you want to help!\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetrwn%2Fnethang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnetrwn%2Fnethang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetrwn%2Fnethang/lists"}