Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: PySF-AutoGenerator: Python bindings for SFML 3.0.0  (Read 1328 times)

0 Members and 1 Guest are viewing this topic.

JasonLeon

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
PySF-AutoGenerator: Python bindings for SFML 3.0.0
« on: November 16, 2025, 04:55:30 pm »
Hi all!

PySF-AutoGenerator is a small, practical tool that auto-generates PyBind11 bindings for SFML 3.0.0 so you can use SFML from Python without writing tons of glue code. It parses SFML headers with LLVM/Clang, stitches in a few targeted “Additions” to cover .inl declarations, and drops out C++ binding sources you can build with CMake. The repo is here:
https://github.com/JasonLeon01/PySF-AutoGenerator .

To try it on Windows, make sure you have Python 3.10, LLVM/Clang, and CMake (version < 4.0). Install clang and pybind11-stubgen for your Python 3.10 environment, clone pybind11 into the project, download the SFML 3.0.0 sources and rename the folder to SFML , then run build.bat . If you already have generated sources, you can jump straight to ProjCMake.bat . On macOS, source generation isn’t supported yet, but you can use the pre-generated source bundle and run ProjCMake.sh .

There’s an Additions/ folder that appends extra binding code where the automatic parsing isn’t enough—especially for stuff living in .inl files. One known limitation right now is clang compile checks complaining about rvalues being bound to sf::String& (non-const reference). I’m gradually refining the generator to avoid those, but if you run into edge cases or have ideas, I’d love help.

If you give it a spin, please share feedback on the Python API feel, any parsing oddities, and platform/compiler quirks. Contributions are very welcome—this is a scrappy project aimed at making SFML more accessible from Python, not a big polished product.