Metadata-Version: 2.4
Name: sse-pex-interface
Version: 1.0.0
Summary: A Python library for reading and writing Skyrim Special Edition Papyrus Script files (.pex).
Author-email: Cutleast <cutleast@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Cutleast
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/cutleast/sse-pex-interface
Project-URL: Issues, https://github.com/cutleast/sse-pex-interface/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic
Dynamic: license-file

# sse-pex-interface

A Python library for reading and writing compiled Papyrus Script files (.pex) for Skyrim Special Edition.

**This is neither a compiler (.psc -> .pex) nor a decompiler (.pex -> .psc)!**

## Features

- Fully symmetrical parse and dump methods
- Fully typed and documented models based on Pydantic
- Automated validation of Papyrus data

## Installation

**With pip**: `pip install sse-pex-interface`

**With uv**: `uv add sse-pex-interface`

## Basic Usage

This example demonstrates how to load a compiled Papyrus Script, modify its header and save it again:

```py
>>> from sse_pex_interface import PexFile
>>> from pathlib import Path
>>> with Path("myscript.pex").open("rb") as stream:
...     pex_file = PexFile.parse(stream)
...
>>> print(pex_file.header)
magic=4200055006 major_version=3 minor_version=2 game_id=1 compilation_time=1767530035 source_file_name='MyScript.psc' username='Cutleast' machinename='CUTLEAST-PC'
>>> pex_file.header.username = "Someone else"
>>> with Path("myscript.pex").open("wb") as stream:
...     pex_file.dump(stream)
...
>>>
```

## Credits

- [Compiled Script File Format Documentation at The Unofficial Elder Scrolls Pages](https://en.uesp.net/wiki/Skyrim_Mod:Compiled_Script_File_Format)
