- npk is a simple package system for multiple files.
- Open, create and manipulate npk packages via python.
- Built on cffi.
Before using pynpk, we need to get libnpk.
$ git clone https://github.com/lqez/npk.git
$ cd npk
$ ./build.sh && cd _build && sudo make install
... or if you're on OS X and using Homebrew, then
$ brew tap lqez/npk
$ brew install npk
$ pip install pynpk
import npk
pack = npk.package("foo.npk") # open package
entity = pack.get("bar.txt") # find entity
open('bar.txt','w').write(entity.read()) # write to file
pack.export("bar.txt") # or just export it
pack.close() # closing