Niema's Python library for reading data from various file system standards
NiemaFS can be installed using pip:
sudo pip install niemafsIf you are using a machine on which you lack administrative powers, NiemaFS can be installed locally using pip:
pip install --user niemafsThe workflow to use each of the NiemaFS classes is as follows:
- Instantiate the appropriate NiemaFS class by providing a path
pathand a file-like objectfile_obj - Iterate over the contents of the NiemaFS object using a for-loop, each iteration of which will yield a
tupleas follows:
for curr_path, curr_timestamp, curr_data in fs:
if curr_data is None:
print('DIR', curr_path, curr_timestamp)
else:
print('FILE', curr_path, curr_timestamp, len(curr_data))See the documentation as well as the example scripts for more information. This repository also contains example files to test the NiemaFS classes.
DirFS — Directories
from niemafs import DirFS
fs = DirFS(path=target_path)GcmFS — Nintendo GameCube Mini-DVD
from niemafs import GcmFS
with open(target_path, 'rb') as target_file:
fs = GcmFS(path=target_path, file_obj=target_file)GcRarcFS — Nintendo GameCube RARC Archive
from niemafs import GcRarcFS
with open(target_path, 'rb') as target_file:
fs = GcRarcFS(path=target_path, file_obj=target_file)IsoFS — ISO 9660 Disc Image
from niemafs import IsoFS
with open(target_path, 'rb') as target_file:
fs = IsoFS(path=target_path, file_obj=target_file)TarFS — TAR Archive
from niemafs import TarFS
with open(target_path, 'rb') as target_file:
fs = TarFS(path=target_path, file_obj=target_file)TgcFS — Nintendo GameCube TGC Image
from niemafs import TgcFS
with open(target_path, 'rb') as target_file:
fs = TgcFS(path=target_path, file_obj=target_file)WiiFS — Nintendo Wii DVD
Note that, due to the need to decrypt the file system, this is extremely memory-intensive (each partition is loaded into memory to process in parallel for speed).
from niemafs import WiiFS
with open(target_path, 'rb') as target_file:
fs = WiiFS(path=target_path, file_obj=target_file)ZipFS — ZIP Archive
from niemafs import ZipFS
with open(target_path, 'rb') as target_file:
fs = ZipFS(path=target_path, file_obj=target_file)The following resources were extremely helpful in the development of NiemaFS: