Skip to main content

Portal Solver Editor SDK - Python Bindings

[EN] | [RU]

pse-sdk-python - Official Python bindings for Portal Solver Editor (PSE) SDK, the official toolkit (SDK) for programmatic work with the in-game editor of Portal: Solver

The library provides a high-level Python API over the low-level C SDK, allowing you to build external level editors, automation tools, plugins, unusual custom levels, and utilities that run in sync with the running game in real time

All the low-level details - shared memory, ring buffers, atomics, byte offsets - are hidden behind a clean Python interface

Installation

pip install pse-sdk-python

Requirements:

  • Windows (the game is Windows-only)
  • Python 3.10+
  • Portal: Solver must be running

Quick start

A basic scenario: connect to the game, create a floor, a button and a door. Make the button open the door

import pse

# Connect to the running game
pse.initialize()

# Build a floor
pse.StaticMesh.create(
    location=(0, 0, -100),
    scale=(10, 10, 1),
    mesh=pse.Mesh.FACE,
    material=pse.Material.FLOOR_WHITE,
)

# Create a button and a door
button = pse.Button()
button.create(location=(200, 200, -100))

door = pse.Door()
door.create(location=(-150, 0, -100))

# Open the door when the button is pressed
@button.on_element_changed()
def on_button_changed(state):
    door.state = state

# Main loop
while True:
    pse.poll_events()

What you can do

  • Elements: doors, buttons, triggers, lasers, faith plates, panels, stairs, cubes, lamps, windows, elevators and more
  • Meshes: static and dynamic geometry with materials
  • Events: callbacks for element state changes
  • Player: position, rotation, spawn, kill
  • Solver Gun & flashlight: give/take, state control, actions
  • Game: cheats, gravity, level initialization

Project structure

  • src/pse/ - Python package source
  • src/pse/pse.dll - bundled PSE SDK dynamic library
  • examples/ - working Python examples

Documentation

A detailed description of the architecture, element specifications and usage guides can be found in the PSE SDK Python Documentation section

  • pse-sdk - the original C SDK (core library, headers, documentation)
  • PSE SDK Documentation - full architecture, element specs and usage guides

Metadata

Release files for pse-sdk-python 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pse-sdk-python 1.0.1
File Size Uploaded Provenance Actions
pse_sdk_python-1.0.1.tar.gz 18.8 kB Without provenance Details for pse_sdk_python-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pse-sdk-python 1.0.1
File Interpreter ABI Platform Actions
pse_sdk_python-1.0.1-py3-none-any.whl Python 3 none any Details for pse_sdk_python-1.0.1-py3-none-any.whl

Total release size: 36.4 kB

Release files / pse_sdk_python-1.0.1.tar.gz

Download URL pse_sdk_python-1.0.1.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ec8bf45090d2e3fdf8e48c88469076ff920913b7e76f6db3df98721ea6c6ae03
BLAKE2b-256 checksum
How to use checksums
94ad8b163c9200702c1c2e234a82b947b49d2f038707489fb379da403dfbd631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / pse_sdk_python-1.0.1-py3-none-any.whl

Download URL pse_sdk_python-1.0.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f43c2f025183d2f64f32086a29436dc59d675aed16877aa796de1eec6bb0387
BLAKE2b-256 checksum
How to use checksums
3fc78aa393bbfd024e3b0f79a519738b8590865a626449c71e4cb6d89fbf07fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for pse-sdk-python 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page