Organize the Slippi game files in your filesystem according to their attributes.
With Python installed, simply run the following command to add the package to your project.
Currently, the package supports organizing the files according to a supplied ordering of parsers, flattening the files against the supplied root folder, and renaming all the files according to their attributes. These may be accomplished programmatically with the use of the
Tree class or through the command-line interface.
organize method serves the purpose of moving each game file found (deeply or otherwise) under the root folder to its proper location according to the supplied ordering of parsers. If no ordering is given, then treefrog will use its default. Here is a simple example of calling this method:
1 2 3 4 5 6 7 8 9 10 11 12
Feel free to provide your own logic for formatting the names of the folders at a particular level with a corresponding iterable of functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Any custom parser you provide will need to be a
Callable that takes in a
Game instance and returns a
Further, you can use cascading methods to simplify your programming. Each of the methods
rename will return a reference to the instance object on which it was called. Something like this:
tree.organize().rename() will both organize and rename the game files.
flatten method serves the simple purpose of moving each game file found (deeply or otherwise) under the root folder back to the root folder itself. Here's an example of what calling this method may look like:
1 2 3 4
Note that you do not have to use
Tree with a context manager. If you do not use the
with keyword as in the first couple of examples, you will need to end your operations with a call to the
resolve method in order to see the changes reflected in your filesystem.
rename method simply renames each game file according to its attributes. Without a rename function supplied, treefrog will use the
default_filename function found in the
treefrog.rename module. Alternatively, you may provide your own rename function as shown below:
1 2 3 4 5 6 7 8 9 10
This is also command-line program, and can be executed as follows:
||Slippi folder root path|
||show this help message and exit|
||The glob pattern to search with|
||Netplay code (e.g. DTB#566)|
||Whether to show a progress bar|
||Whether to restore the filenames to their defaults|
||Whether to organize the folder hierarchy|
||Whether to flatten your Slippi game files to a shared parent folder|
||Whether to rename the files according to their features|
For example, the following command will organize all the game files under the
slp directory with a progress bar.
Feel free to check out the docs for more information.
This software is released under the terms of MIT license.