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.1.tar.gz
(111.7 kB
view hashes)
Built Distributions
nod-1.0.1-cp37-cp37m-win_amd64.whl
(384.7 kB
view hashes)
nod-1.0.1-cp36-cp36m-win_amd64.whl
(384.8 kB
view hashes)
Close
Hashes for nod-1.0.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 004c48b777b988bcab807e38d9aa27c8b67dac1ad245fc23efde339998d57a88 |
|
MD5 | 6ee3809517bc2a35d65e7bce1877282e |
|
BLAKE2b-256 | 562a0d635dc9e13d038216cd15f89774828c4d9ff6f9d863d80adfd7c5bce9d0 |
Close
Hashes for nod-1.0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14690c5ca80e27440dd652a29bada73a2f7346dd33929c1821d78a023a7c2a80 |
|
MD5 | 9e4c68f38c5cb3d689b83558aa6d7ed7 |
|
BLAKE2b-256 | 5f3ec2a8618b1b4002d9132037efdcdd3f04e045794e1c23aed603fff40f71ff |