Skip to main content

Python bindings for the nod library.

Project description

py-nod

Python 3.6 bindings for the NOD, a library for traversing, dumping, and authoring GameCube and Wii optical disc images.

Usage

Unpacking

import nod

def progress_callback(path, progress):
    if args.verbose:
        print("Extraction {:.0%} Complete; Current node: {}".format(progress, path))

context = nod.ExtractionContext()
context.set_progress_callback(progress_callback)

try:
    disc, is_wii = nod.open_disc_from_image("game.iso")
    data_partition = disc.get_data_partition()
    if not data_partition:
        raise RuntimeError("Could not find a data partition in the disc.")
    data_partition.extract_to_directory("dir_out", context)
except RuntimeError as e:
    raise Exception("Could not extract disc at 'game.iso' to 'dir_out': {}".format(e))

Packing

import nod

if nod.DiscBuilderGCN.calculate_total_size_required("dir_out") is None:
    raise Exception("Image built with given directory would pass the maximum size.")

def fprogress_callback(progress: float, name: str, bytes: int):
    print("\r" + " " * 100, end="")
    print("\r{:.0%} {} {} B".format(progress, name, bytes), flush=True)

disc_builder = nod.DiscBuilderGCN("game.iso", fprogress_callback)
try:
    disc_builder.build_from_directory("dir_out")    
except RuntimeError as e:
    raise Exception("Failure building the image: {}".format(e))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nod, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size nod-1.2.1-cp35-cp35m-manylinux2010_x86_64.whl (1.3 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size nod-1.2.1-cp36-cp36m-macosx_10_14_x86_64.whl (501.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size nod-1.2.1-cp36-cp36m-manylinux2010_x86_64.whl (1.3 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size nod-1.2.1-cp36-cp36m-win_amd64.whl (772.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size nod-1.2.1-cp37-cp37m-macosx_10_14_x86_64.whl (501.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size nod-1.2.1-cp37-cp37m-manylinux2010_x86_64.whl (1.3 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size nod-1.2.1-cp37-cp37m-win_amd64.whl (772.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size nod-1.2.1-cp38-cp38-macosx_10_14_x86_64.whl (501.1 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size nod-1.2.1-cp38-cp38-manylinux2010_x86_64.whl (1.4 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size nod-1.2.1-cp38-cp38-win_amd64.whl (772.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size nod-1.2.1.tar.gz (826.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page