CLI tool and Python library for managing Playstation 3 image files
Project description
PS3ISO
Command line tool and Python library for managing existing Playstation 3 image files
Installing
pip install ps3iso
Dependencies
isoinfo
isoinfo
needs to be in the system PATH in order to extract SFO data directly from .iso images
Windows: https://smithii.com/files/cdrtools-latest.zip
macOS: brew install cdrtools
Linux: brew install genisoimage
Quick Program Help
usage: [-h] -i INPUT [-f FORMAT] [--rename]
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Path to the PS3 ISO file or directory containing PS3
ISO files
-f FORMAT, --format FORMAT
Format string to use for output or --rename target
--rename Rename .iso and supporting files to a format string
based on PS3 metadata
To rename all ISO files, plus all files with a matching name to a nice format:
$ ps3iso -i /path/to/isos -f '%I-[%T]' --rename
This will rename .iso
files by reading the game's metadata. It will also find any files with the same name, but different extension. The file name will be based on the format string given by -f
and the following variables are expanded:
Variable | Parameter |
---|---|
%a | APP_VER |
%a | ATTRIBUTE |
%C | CATEGORY |
%L | LICENSE |
%P | PARENTAL_LEVEL |
%R | RESOLUTION |
%S | SOUND_FORMAT |
%T | TITLE |
%I | TITLE_ID |
%V | VERSION |
%v | PS3_SYSTEM_VER |
Therefore, the above command will look in /path/to/isos
for all ISO files (e.g. UnknownGame.iso
) and rename it according to %I-[%T]
(e.g. BLES0000-[Game Title].iso
)
Additionally, all matching extra files (e.g. UnknownGame.png
) will be renamed (e.g. BLES0000-[Game Title].png
)
When not renaming files, the --format
argument will also expand additional variables:
Variable | Parameter |
---|---|
%f | File name |
%p | File full path |
\n | Newline character |
\t | Tab character |
The following will output a JSON object for each file found:
ps3iso -i /path/to/isos -f '{\n\t"file": "%F",\n\t"title": "%T",\n\t"ID": "%I"\n}'
{
"file": "/path/to/isos/UnknownGame.iso",
"title": "Game Title",
"ID": "BLES00000"
}
Quick Library Examples
Renaming all ISO's in /path/to/iso/files
to BLES0000-[Game Title].iso
format:
from ps3iso.game import Game
games = Game.search('/path/to/iso/files')
Game.rename_all(list(games), '%I-[%T]')
Print a JSON object per game containing file path, game title, and game id:
from ps3iso.game import Game
for game in Game.search('.'):
game.print_info('{"file":"%p", "title":"%T", "ID":"%I"}')
Loop over all ISO files and matching associated files, and generate a new filename in Game Title [BLES0000].ext
format
from ps3iso.game import Game
games = Game.search('/path/to/iso/files')
for game in games:
for f in game.files:
print("Old name = %s" % f)
print("New name = %s" % game.format_file(f, '%T [%I]'))
Open an existing PARAM.SFO file and print all valid SFO attributes
from ps3iso.sfo import SfoFile
with open('/path/to/PARAM.SFO', 'rb') as f:
sfo = SfoFile.parse(f)
for key, value in sfo:
print("key=%s, value=%r" % (key, value))
Read a specific attribute (TITLE_ID
) from an existing PARAM.SFO
from ps3iso.sfo import SfoFile
sfo = SfoFile.parse_file('/path/to/PARAM.SFO')
print("Game ID = %s" % sfo.TITLE_ID)
print(sfo.format("Game Title = %T\n"))
Development - New release
- Make sure the tests pass and docs build:
make coverage; make doc
- Update the version number in setup.py
- Create a tag for the version e.g.:
git tag v1.2.3
- Build and upload to PyPi:
make upload
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ps3iso-0.3.5.tar.gz
.
File metadata
- Download URL: ps3iso-0.3.5.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 528f68ee0cfc5cf6646339b2a36ee1e5c9c2f0365b4d0c1b2368d6fd49b96f4a |
|
MD5 | 5cbec9450c0ca22d774b9742adc1d568 |
|
BLAKE2b-256 | bf5fea88dca080c6d6524353ac9c01be47d06b76ba1267308f5340e65bffe837 |
File details
Details for the file ps3iso-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: ps3iso-0.3.5-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed386c99ebcf565006fd31a0583f3eb554508c70e70688d89a05e254d322d4c |
|
MD5 | ecc812d61938aebee5064536ac9321e9 |
|
BLAKE2b-256 | a73a55462977d8892633d88199d525bb93e5890b4bc8556aaf54ab6dfd6bee3e |