mpyq

A Python library for extracting MPQ (MoPaQ) files
Download

mpyq Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Publisher Name:
  • Aku Kotkavuo
  • Publisher web site:
  • http://github.com/arkx/

mpyq Tags


mpyq Description

A Python library for extracting MPQ (MoPaQ) files mpyq is a Python library for extracting MPQ (MoPaQ) files.mpyq is a Python library for reading MPQ (MoPaQ) archives used in many of Blizzard's games. It was originally developed for data mining Starcraft II replay files.In addition to being a library, mpyq also has a command line interface that exposes some of the library's core functionality such as extracting archives.At this early stage in development only files compressed with DEFLATE or bzip2 are uncompressed. This means that this library can not be used to extract most big game asset archives that Blizzard's games use. More compression formats will be supported in the future.Also, as mpyq is so far pure Python code, it might be unfeasible to try to extract very large MPQ archives, even if all the compression methods used inside the archive were supported.Note that listing files inside an archive does not require full extraction. You can safely take a peek inside any MPQ archive with this library.Installationmpyq can be installed with the included setup.py script.python setup.py installRunning this command will install mpyq both as a library and a stand-alone script that can be run from anywhere, provided that you have added Python's bin directory to your PATH environment variable.Alternative way to install mpyq is to clone this git repository somewhere on your filesystem and then either adjust your PYTHONPATH environment variable to point to the directory that contains the repository or create a symbolic link to your Python's site-packages directory pointing at the repository.UsageAs a library>>> from mpyq import MPQArchive>>> archive = MPQArchive('game.SC2Replay')Now you have a MPQArchive object of the file you opened. One common thing to do now is to extract the files from the archive.>>> files = archive.extract()This will extract and return the archive's contents in memory. Be advised that you might not want to do this with multi-gigabyte MPQ files from World of Warcraft, for example.Files inside the archive can be also extracted and written to disk.>>> archive.extract_to_disk()For more information, consult help(mpyq) in your Python console. Requirements: · Python


mpyq Related Software