From 3b195dfe53b547ccd21788e6763abdc8c8bbb9d1 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:19:31 -0400 Subject: [PATCH] Added proper README file --- README.md | 30 +++++++++++++++++++++++++++++- wiipy.py | 8 ++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2d8f9b1..3968201 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # WiiPy -A simple CLI tool that serves as a reference implementation of libWiiPy. +WiiPy is a simple command line tool to use [libWiiPy](https://github.com/NinjaCheetah/libWiiPy)'s features to manage file formats used on the Wii. WiiPy also serves as a relatively simple reference implementation for libWiiPy's features, as it's designed to utilize all of them. + +WiiPy is cross-platform, and supports macOS, Windows, and Linux, both because it's written in pure Python, and because it can be compiled for all three platforms via Nuitka. + +To see what features are supported, I would recommend checking out the list of features that libWiiPy offers, which can be found [here]("https://github.com/NinjaCheetah/libWiiPy?tab=readme-ov-file#features"). + +## Requirements +libWiiPy has been tested on both Python 3.11 and 3.12, and works as expected in both places. libWiiPy *should* support Python 3.10, however this is not verified. WiiPy only relies on libWiiPy, so it supports the same Python versions. + +To make sure you have libWiiPy and all of its dependencies, you can simply run: +```shell +pip install -r requirements.txt +``` + +## Usage +Basic usage for WiiPy is very simple. +```shell +python3 wiipy.py +``` +You can use `--help` to see a list of all subcommands, or use ` --help` to see usage instructions for that subcommand. + +Available subcommands will expand as support for more features are added into libWiiPy. WiiPy is designed around libWiiPy's `main` branch, so any features that have been merged into main are likely to be supported here within a short period of time. This also means that any breaking changes to the library will be handled here quickly, so incompatibilities shouldn't happen. + +## Compiling +If you'd like to compile WiiPy from Python into something a little more native, you can use one of the following commands. Make sure you've installed Nuitka first (it's included in `requirements.txt`). +```shell +python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py +``` +On macOS and Linux, this will give you a binary named `wiipy.bin` in the same directory as the Python file. On Windows, you'll get a binary named `wiipy.exe` instead. diff --git a/wiipy.py b/wiipy.py index 19f76cf..156ddd4 100644 --- a/wiipy.py +++ b/wiipy.py @@ -2,6 +2,7 @@ # https://github.com/NinjaCheetah/WiiPy import argparse +from importlib.metadata import version from modules.wad import * from modules.nus import * @@ -9,7 +10,10 @@ from modules.u8 import * from modules.ash import * if __name__ == "__main__": - parser = argparse.ArgumentParser(description="WiiPy is a simple CLI tool to manage file formats used by the Wii.") + parser = argparse.ArgumentParser( + description="WiiPy is a simple command line tool to manage file formats used by the Wii.") + parser.add_argument("--version", action="version", + version=f"WiiPy v1.0.0, based on libWiiPy v{version('libWiiPy')} (from branch \'main\')") subparsers = parser.add_subparsers(dest="subcommand", required=True) wad_parser = subparsers.add_parser("wad", help="pack/unpack a WAD file", @@ -26,7 +30,7 @@ if __name__ == "__main__": nus_parser.set_defaults(func=handle_nus) nus_parser.add_argument("tid", metavar="TID", type=str, help="Title ID to download") nus_parser.add_argument("-v", "--version", metavar="VERSION", type=int, - help="Version to download") + help="version to download (optional)") u8_parser = subparsers.add_parser("u8", help="pack/unpack a U8 archive", description="pack/unpack a U8 archive")