Skip to content

Commit

Permalink
v2.0.0: ZiX-12B full support, fixes, restructure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lattyware committed Apr 28, 2019
1 parent 36ee53c commit f54191b
Show file tree
Hide file tree
Showing 15 changed files with 833 additions and 326 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__
.idea
dist/
build
*.egg-info
85 changes: 59 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,64 @@

## About

unrpa is a script to extract files from the RPA archive format created
for [the Ren'Py Visual Novel Engine](http://www.renpy.org/).
unrpa is a tool to extract files from the RPA archive format (from
[the Ren'Py Visual Novel Engine](http://www.renpy.org/).

It can also be used as a library.

## Installation

### Package manager

The best way to install unrpa is through your package manager, if a package is available for your operating system.
I maintain [an AUR package](https://aur.archlinux.org/packages/unrpa/)) for Arch Linux users.

### pip

You can also install unrpa through pip, the Python package manager. You can do this on Windows with:

py -3 -m pip install "unrpa"

Or use `python3` rather than `py -3` on unix systems. You can see
[the official documentation](https://packaging.python.org/tutorials/installing-packages/) for more help installing
through pip.

### From source

You can also [download the latest release](https://github.com/Lattyware/unrpa/releases/latest)
and extract it.

## Dependencies

You will need Python 3.4 or later in order to run it (either install through
You will need Python 3.7 or later in order to run it (either install through
your package manager or
[directly from python.org](https://www.python.org/downloads/)).

## Installation
If you are trying to extract more exotic RPA archives, there may be additional dependencies. unrpa should instruct
you how to install them if required.

### Examples

When installed through your package manager or pip, you should be able to use unrpa by opening a terminal or command
prompt and doing something like:

unrpa -mp "path/to/output/dir" "path/to/archive.rpa"

If you are running from source, you will need execute python directly:

You can [download the latest release](https://github.com/Lattyware/unrpa/releases/latest)
and then run the script as described below.
- On most unix systems, open a terminal in the directory containing unrpa then:

python3 -m unrpa -mp "path/to/output/dir" "path/to/archive.rpa"
- On most Windows systems, open a Command Prompt in the directory containing unrpa then:

py -3 -m unrpa -mp "path\to\output\dir" "path\to\archive.rpa"

## Command Line Usage

```
usage: unrpa [-h] [-v] [-s] [-l] [-p PATH] [-m] [-f VERSION]
[--continue-on-error]
[--continue-on-error] [-o OFFSET] [-k KEY] [--version]
FILENAME
```

Expand All @@ -30,22 +69,16 @@ usage: unrpa [-h] [-v] [-s] [-l] [-p PATH] [-m] [-f VERSION]
|---------------------|--------------------------|
| FILENAME | the RPA file to extract. |

| Optional Argument | Description |
|------------------------------|------------------------------------------------------------|
| -h, --help | show this help message and exit |
| -v, --verbose | explain what is being done [default]. |
| -s, --silent | no output. |
| -l, --list | only list contents, do not extract. |
| -p PATH, --path PATH | will extract to the given path. |
| -m, --mkdir | will make any non-existent directories in extraction path. |
| -f VERSION, --force VERSION | forces an archive version. May result in failure. |
| --continue-on-error | try to continue extraction when something goes wrong. |

### Examples

- On most unix systems, open a terminal, then:
`python3 unrpa -mp "path/to/output/dir" "path/to/archive.rpa"`
- On most Windows systems, open a Command Prompt, then:
`py -3 unrpa -mp "path\to\output\dir" "path\to\archive.rpa"`


| Optional Argument | Description |
|------------------------------|----------------------------------------------------------------|
| -h, --help | show this help message and exit |
| -v, --verbose | explain what is being done [default]. |
| -s, --silent | no output. |
| -l, --list | only list contents, do not extract. |
| -p PATH, --path PATH | will extract to the given path. |
| -m, --mkdir | will make any non-existent directories in extraction path. |
| -f VERSION, --force VERSION | forces an archive version. May result in failure.<br>Possible versions: RPA-3.0, ZiX-12B, ALT-1.0, RPA-2.0, RPA-1.0. |
| --continue-on-error | try to continue extraction when something goes wrong. |
| -o OFFSET, --offset OFFSET | sets an offset to be used to decode unsupported archives. |
| -k KEY, --key KEY | sets a key to be used to decode unsupported archives. |
| --version | show program's version number and exit |
7 changes: 7 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[mypy]
python_version = 3.7
warn_unused_configs = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_any_generics = True
strict_optional = True
26 changes: 26 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import setuptools # type: ignore

with open("README.md", "r") as readme:
long_description = readme.read()

setuptools.setup(
name="unrpa",
version="2.0.0",
author="Gareth Latty",
author_email="gareth@lattyware.co.uk",
description="Extract files from the RPA archive format (from the Ren'Py Visual Novel Engine).",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Lattyware/unrpa",
packages=setuptools.find_packages(),
python_requires=">=3.7",
keywords="renpy rpa archive extract",
classifiers=[
"Topic :: System :: Archiving",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
"Environment :: Console",
],
entry_points={"console_scripts": ["unrpa = unrpa:__main__"]},
)
Loading

0 comments on commit f54191b

Please sign in to comment.