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.

Source Distribution

nod-1.2.0.tar.gz (823.8 kB view hashes)

Uploaded Source

Built Distributions

nod-1.2.0-cp38-cp38-win_amd64.whl (681.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

nod-1.2.0-cp38-cp38-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

nod-1.2.0-cp38-cp38-macosx_10_14_x86_64.whl (460.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

nod-1.2.0-cp37-cp37m-win_amd64.whl (681.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

nod-1.2.0-cp37-cp37m-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

nod-1.2.0-cp37-cp37m-macosx_10_14_x86_64.whl (460.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

nod-1.2.0-cp36-cp36m-win_amd64.whl (681.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

nod-1.2.0-cp36-cp36m-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

nod-1.2.0-cp36-cp36m-macosx_10_14_x86_64.whl (460.9 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

nod-1.2.0-cp35-cp35m-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page