Skip to main content

Python bindings for SFML 3

Project description

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.system
  • sfml.window
  • sfml.graphics
  • sfml.audio
  • sfml.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 guidance
  • docs/recipes.md: minimal task-oriented snippets for common PySFML patterns
  • docs/modules.md: module overview and import strategy
  • docs/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 module
  • docs/compatibility.md: support boundaries, known differences, and unsupported features
  • examples/README.md: maintained examples policy and classification
  • pyproject.toml: packaging metadata and test configuration
  • .github/workflows/: CI, release, and TestPyPI validation workflows

The repository source of truth is GitHub:

Author

Jonathan De Wachter dewachter.jonathan@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sfml-3.0.2.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sfml-3.0.2.0-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

sfml-3.0.2.0-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

sfml-3.0.2.0-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

sfml-3.0.2.0-cp310-cp310-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.10Windows x86-64

sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file sfml-3.0.2.0.tar.gz.

File metadata

  • Download URL: sfml-3.0.2.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sfml-3.0.2.0.tar.gz
Algorithm Hash digest
SHA256 679ec2cead29c9de5835438ebfe5f8a14fd025b06bcdcced1b624eb98ec40b69
MD5 0f6949b12d9a21093cf0ec9123eaf8c2
BLAKE2b-256 1c0ed7e78c7e5eb2f81e9989dee19baf12003a12a191f7c1f2b0cb25fbc429eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0.tar.gz:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sfml-3.0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sfml-3.0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6d5bb8c3a30ad75e99b4166a34becfd1c0686a05c71021cf82bc02b8c5c4812e
MD5 6efd6dc689b1765f947814304eaf77dc
BLAKE2b-256 e49829c73f27132c9371864c9aec4c9694551898f83fa19866c90da21327d818

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce7cbec00dbe029a0155bd795cffb19c1c3d94e4c7de1a6e218adf14b2a2f05e
MD5 0191cee4097e702ed0a005c2409e81f6
BLAKE2b-256 eb18f75be3a9c5f104603b787fda93ec0c4f5b90510b67003b6b4b209f43cb36

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1a88a44212ae075d8707e5641ce46ce25f77eb2e01d986924589505a68f62e03
MD5 8718ec257751f8db3c781ac78163e538
BLAKE2b-256 2b57ee036273495a0c4c8209c735ff9f0848ab963ae918d2fd34fd81c7f8984e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sfml-3.0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sfml-3.0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f6b4609b4635669b0c049dd41933f23c488eb1a004a43b02ce1cdccd87b3ae11
MD5 24b01fe2fb39558591e9dda62141c815
BLAKE2b-256 713ebd0e7a5b77f5c85bba8e2b08fded6e97ca5df709bee6cc58c08239ce2299

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 976500335f9e1209e8a471c25a2484c49e9b9514ef75c164ea4eeeb4f3625dcd
MD5 fb8a9d863ef7dc653e4d50f6a66fef8a
BLAKE2b-256 2239f4c73335f5fb2cbe743e730712b86c2f24bec4424f84081e80ca31a2e5cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d4bfe281cb9256da3b8bbfc56908d05a7f007bf5d8f28977906c577b60afea3a
MD5 232501dbd8f2dd6cfc1cff630e2721c9
BLAKE2b-256 5ea2d07583cfb4d149399c6beab9e7924c7e82dd7314e04e713288a43444f0ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sfml-3.0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sfml-3.0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 74bb8f4791a1d19ee0fb0b84a87899c65ca25c319697b593bf8730da71d916db
MD5 a791b03036838bef646127db3bc72b82
BLAKE2b-256 5489ed6b5b3434bf6bad0edc82a4408b814fd89e5f9a382bd88e1dc7464401b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 092add4e112c8bd04703c36a1cad283138ae15e3ba921de9c36535253bf20a2d
MD5 7c3963e7af1f9c208634585ba845e581
BLAKE2b-256 69679eb6a84fe3fba523d77f01e0099c4b81e6d098f83190a07548a19fe376c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fd74fa219519b311d106490140e4d0fd4952c6af87f0b20e30d685bc76acb615
MD5 2713b14c1425e0184763d6d92ea0121f
BLAKE2b-256 5c3b89d3ca4ee608e26ed84f567b8718a85392f5fafa050bb5635e5da253ad1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sfml-3.0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sfml-3.0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 600a132df5af422a54ec6f4e31165114f9f6855d7880468ee4307670b84147a5
MD5 fe594495dfdb50dd7ebdaecf908774ae
BLAKE2b-256 9608c830a0ab811dd5d9372df6b833f5593807b5bf09492630cf28680289cb7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 679ea3665d1aa0ed31b57cb4c3e9da55b21b93d6e1cd9a6dd65f245cefe6db5e
MD5 356e96d9204b1ba623688b192643dd08
BLAKE2b-256 ade958153860aa7a43d03585ac47d1dd4a62d8ee24b2eef8d7dc9a6075636025

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c0b326e06fe7c65e7c65e2dccabb48a4ba66d3dac811d0eea540d2426c544536
MD5 dcc47a92c2d305b85a7066cc4709b26b
BLAKE2b-256 221b76e1d7a4a2905541226a70a4183b3f78fc78577263a3931b14e8d9ce655f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-3.0.2.0-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: release.yml on intjelic/python-sfml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page