A pure Python library for reading and writing Skyrim Special Edition Plugin files (.esp, .esm, .esl).
See here for more information about the Plugin file format: https://en.uesp.net/wiki/Skyrim_Mod:Mod_File_Format
Please note that this library was originally intended for extraction of strings that are visible in-game. Other features may not be fully implemented or tested and are used at your own risk!
Run pip install sse-plugin-interface to install the library in the current active environment.
From file:
>>> plugin = SSEPlugin.from_file(Path("my_plugin.esp"))Directly from a stream of bytes:
>>> plugin = SSEPlugin.from_file(open("my_plugin.esp"), "my_plugin.esp")>>> strings: list[PluginString] = SSEPlugin.from_file(Path("my_plugin.esp")).extract_strings()See here for information about the PluginString type: plugin_string.py
>>> plugin = SSEPlugin.from_file(Path("my_plugin.esp"))
>>> plugin.replace_strings([PluginString(...), ...])Dump the plugin data to a byte array:
>>> plugin.dump()
b"This is the dumped content of the plugin"Save the plugin data to a file:
>>> plugin.save(Path("output.esp"))