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") == -1:
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
Release history Release notifications | RSS feed
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.0.0.tar.gz
(107.0 kB
view hashes)
Built Distributions
nod-1.0.0-cp37-cp37m-win_amd64.whl
(384.7 kB
view hashes)
nod-1.0.0-cp36-cp36m-win_amd64.whl
(422.5 kB
view hashes)
Close
Hashes for nod-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9387d08ba17b1312ca6cfc0391d6ce39da777791abf74943c443c6f055949fcb |
|
MD5 | c28f2c7324a576c6412388890d2fc8e8 |
|
BLAKE2b-256 | 9cf98f6ad72eff198fd59b8ec2486e1910ffc263ffcb876a32c05d2958d45278 |
Close
Hashes for nod-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e765555e2b106e970701ca1c5f8cdaf44583db8ed5385ed5c379d8dce4fd0a |
|
MD5 | 02e985fb497aca7f19b9d665568ceb30 |
|
BLAKE2b-256 | 295b37bf5c4a94ed72019be64081ef3ba3a4f29d7bdae03d2d0949d06ab71a88 |