Skip to main content

PS3ISO

Command line tool and Python library for managing existing Playstation 3 and Playstation Portable image files

PyPI version builds.sr.ht status Documentation Status Coverage PyPI - License PyPI - Downloads

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 ISO file or directory containing 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 SFO 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('test/data/PARAM.SFO', 'rb') as f:
...	   sfo = SfoFile.parse(f)
>>> for key, value in sfo:
...     print("%s=%r" % (key, value))
APP_VER='01.00'
ATTRIBUTE=32
BOOTABLE=1
CATEGORY='DG'
LICENSE='Some example license text, Supports UTF8 glyphs like ©and ®.'
PARENTAL_LEVEL=5
PS3_SYSTEM_VER='02.5200'
RESOLUTION=63
SOUND_FORMAT=1
TITLE='Example PS3ISO Game Title'
TITLE_ID='BLES00000'
VERSION='01.00'

Read a specific attribute (TITLE_ID) from an existing PARAM.SFO

>>> from ps3iso.sfo import SfoFile
>>> sfo = SfoFile.parse_file('test/data/PARAM.SFO')
>>> print("Game ID = %s" % sfo.parameters.TITLE_ID)
Game ID = BLES00000
>>> print(sfo.format("Game Title = %T"))
Game Title = Example PS3ISO Game Title

Development - New release

  1. Make sure the tests pass and docs build: make coverage; make doc
  2. Update the version number in setup.py
  3. Create a tag for the version e.g.: git tag v1.2.3
  4. Build and upload to PyPi: make upload

Metadata

Release files for ps3iso 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ps3iso 0.4.1
File Size Uploaded
ps3iso-0.4.1.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ps3iso 0.4.1
File Interpreter ABI Platform
ps3iso-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / ps3iso-0.4.1.tar.gz

Download URL ps3iso-0.4.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
df93c408f8dee4c52c43e7070864e1f1ee72ff6fa85707d2242987f47707b211
BLAKE2b-256 checksum
How to use checksums
34183e03c0f72607dbc20124a8d2a8cfcfc499d820e15289967a2d32bc5cdbf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / ps3iso-0.4.1-py3-none-any.whl

Download URL ps3iso-0.4.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
427d126dd6e86a12a4b53ee0facfd335067895f7bba66e49c76c75f6deb9c771
BLAKE2b-256 checksum
How to use checksums
55e7e72a8d1729c2f8aff266c236cf786487d389405742f4b8f2f73f774ccc25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page