PySFML
PySFML provides Python bindings for SFML.
This release line targets SFML 3.0.2.
PySFML is distributed under the terms of the zlib license.
Status
- Supported Python versions: 3.10+
- Upstream target: SFML 3.0.2
- Packaging baseline: pyproject.toml, setuptools, setuptools-scm, Cython 3.2.x
- Test baseline: pytest smoke coverage for all compiled modules plus curated window and graphics coverage under Xvfb on Linux
- Published distribution name: SFML
- Import namespace: sfml
Installation
Install the current release from PyPI:
python -m pip install --upgrade pip
python -m pip install SFML
If you need the older bindings for SFML 2.6.2, install that release explicitly:
python -m pip install SFML==2.6.2
For local development or custom SFML builds, install from a local checkout against a local SFML install:
python -m pip install --upgrade pip
export SFML_INSTALL_PREFIX=/path/to/sfml
python -m pip install .
If you prefer explicit paths, set SFML_HEADERS and SFML_LIBRARIES instead of SFML_INSTALL_PREFIX.
Quick Example
The following PySFML program is the direct Python-style equivalent of the classic SFML C++ example that opens a window, displays a sprite and some text, and plays music:
from sfml import audio, graphics, window
render_window = graphics.RenderWindow(
window.VideoMode(800, 600),
"PySFML window",
)
texture = graphics.Texture.from_file("cute_image.jpg")
sprite = graphics.Sprite(texture)
font = graphics.Font.from_file("arial.ttf")
text = graphics.Text(font, "Hello SFML", 50)
music = audio.Music.from_file("nice_music.ogg")
music.play()
while render_window.is_open:
for event in render_window.events:
if isinstance(event, window.ClosedEvent):
render_window.close()
render_window.clear()
render_window.draw(sprite)
render_window.draw(text)
render_window.display()
The main differences from the C++ form are:
- resource loading is constructor-style via
from_file(...) - events are concrete typed objects such as
window.ClosedEvent - the event loop is exposed as
render_window.events - module imports are the preferred style instead of a single monolithic namespace
The example above reflects the current Python binding surface.
On the audio side, PySFML exposes the SFML 3 listener, device, and channel-map surface, including PlaybackDevice, SoundChannel, Cone, richer SoundSource state, and Music.loop_points.
See docs/getting-started.md for source-build prerequisites and the local build flow.
Package Layout
The bindings are organized by SFML module:
sfml.systemsfml.windowsfml.graphicssfml.audiosfml.network
The sfml.sf module remains available as a convenience import that re-exports the full binding surface, but the module-specific imports are the primary structure of the project.
See docs/modules.md for a module-by-module orientation.
See docs/compatibility.md for Python-specific behavior differences, unsupported features, and known parity gaps.
Examples
The examples tree is curated around maintained upstream-aligned examples only.
See examples/README.md for the current examples policy and classification.
Development
Local source-build prerequisites and test commands are documented in docs/getting-started.md.
Packaging metadata and test configuration live in pyproject.toml.
The CI and release workflows referenced below live in .github/workflows/.
CI And Releases
The repository includes CI, release, and TestPyPI validation workflows under .github/workflows/.
For contributor-facing release and packaging details, see CONTRIBUTING.md together with the workflow definitions in .github/workflows/.
Documentation
docs/getting-started.md: installation and source-build guidancedocs/recipes.md: minimal task-oriented snippets for common PySFML patternsdocs/modules.md: module overview and import strategydocs/system-module.md,docs/window-module.md,docs/graphics-module.md,docs/audio-module.md,docs/network-module.md: quick Python-oriented guides for each primary moduledocs/compatibility.md: support boundaries, known differences, and unsupported featuresexamples/README.md: maintained examples policy and classificationpyproject.toml: packaging metadata and test configuration.github/workflows/: CI, release, and TestPyPI validation workflows
The repository source of truth is GitHub:
- Repository: https://github.com/intjelic/python-sfml
- Issues: https://github.com/intjelic/python-sfml/issues
Author
Jonathan De Wachter dewachter.jonathan@gmail.com
Release files for SFML 3.0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sfml-3.0.2.0.tar.gz | 2.0 MB | Details |
Built distributions (wheels)
Total release size: 47.5 MB
Release files / sfml-3.0.2.0.tar.gz
| Download URL | sfml-3.0.2.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
679ec2cead29c9de5835438ebfe5f8a14fd025b06bcdcced1b624eb98ec40b69
|
|
BLAKE2b-256 checksum How to use checksums |
1c0ed7e78c7e5eb2f81e9989dee19baf12003a12a191f7c1f2b0cb25fbc429eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp313-cp313-win_amd64.whl
| Download URL | sfml-3.0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6d5bb8c3a30ad75e99b4166a34becfd1c0686a05c71021cf82bc02b8c5c4812e
|
|
BLAKE2b-256 checksum How to use checksums |
e49829c73f27132c9371864c9aec4c9694551898f83fa19866c90da21327d818
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce7cbec00dbe029a0155bd795cffb19c1c3d94e4c7de1a6e218adf14b2a2f05e
|
|
BLAKE2b-256 checksum How to use checksums |
eb18f75be3a9c5f104603b787fda93ec0c4f5b90510b67003b6b4b209f43cb36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1a88a44212ae075d8707e5641ce46ce25f77eb2e01d986924589505a68f62e03
|
|
BLAKE2b-256 checksum How to use checksums |
2b57ee036273495a0c4c8209c735ff9f0848ab963ae918d2fd34fd81c7f8984e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp312-cp312-win_amd64.whl
| Download URL | sfml-3.0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f6b4609b4635669b0c049dd41933f23c488eb1a004a43b02ce1cdccd87b3ae11
|
|
BLAKE2b-256 checksum How to use checksums |
713ebd0e7a5b77f5c85bba8e2b08fded6e97ca5df709bee6cc58c08239ce2299
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
976500335f9e1209e8a471c25a2484c49e9b9514ef75c164ea4eeeb4f3625dcd
|
|
BLAKE2b-256 checksum How to use checksums |
2239f4c73335f5fb2cbe743e730712b86c2f24bec4424f84081e80ca31a2e5cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl
| Download URL | sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d4bfe281cb9256da3b8bbfc56908d05a7f007bf5d8f28977906c577b60afea3a
|
|
BLAKE2b-256 checksum How to use checksums |
5ea2d07583cfb4d149399c6beab9e7924c7e82dd7314e04e713288a43444f0ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp311-cp311-win_amd64.whl
| Download URL | sfml-3.0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
74bb8f4791a1d19ee0fb0b84a87899c65ca25c319697b593bf8730da71d916db
|
|
BLAKE2b-256 checksum How to use checksums |
5489ed6b5b3434bf6bad0edc82a4408b814fd89e5f9a382bd88e1dc7464401b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.5 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
092add4e112c8bd04703c36a1cad283138ae15e3ba921de9c36535253bf20a2d
|
|
BLAKE2b-256 checksum How to use checksums |
69679eb6a84fe3fba523d77f01e0099c4b81e6d098f83190a07548a19fe376c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fd74fa219519b311d106490140e4d0fd4952c6af87f0b20e30d685bc76acb615
|
|
BLAKE2b-256 checksum How to use checksums |
5c3b89d3ca4ee608e26ed84f567b8718a85392f5fafa050bb5635e5da253ad1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp310-cp310-win_amd64.whl
| Download URL | sfml-3.0.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
600a132df5af422a54ec6f4e31165114f9f6855d7880468ee4307670b84147a5
|
|
BLAKE2b-256 checksum How to use checksums |
9608c830a0ab811dd5d9372df6b833f5593807b5bf09492630cf28680289cb7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
679ea3665d1aa0ed31b57cb4c3e9da55b21b93d6e1cd9a6dd65f245cefe6db5e
|
|
BLAKE2b-256 checksum How to use checksums |
ade958153860aa7a43d03585ac47d1dd4a62d8ee24b2eef8d7dc9a6075636025
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency logRelease files / sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl
| Download URL | sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c0b326e06fe7c65e7c65e2dccabb48a4ba66d3dac811d0eea540d2426c544536
|
|
BLAKE2b-256 checksum How to use checksums |
221b76e1d7a4a2905541226a70a4183b3f78fc78577263a3931b14e8d9ce655f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency log