Skip to main content

Python bindings for SFML

Project description

PySFML

PySFML provides Python bindings for SFML.

The current package targets SFML 2.6.2 with modern Python packaging, pytest-based validation, and wheel builds.

PySFML is distributed under the terms of the zlib license.

Installation

Install the published package with pip:

python -m pip install SFML

Binary wheels are the preferred installation path.

Current Baseline

  • Supported Python versions: 3.10+
  • Bound SFML release: 2.6.2
  • Packaging baseline: pyproject.toml, setuptools, setuptools-scm, Cython 3.2.x
  • Validation baseline: pytest smoke coverage for all compiled modules plus curated window and graphics coverage under Xvfb on Linux

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("Hello PySFML", font, 50)

music = audio.Music.from_file("nice_music.ogg")
music.play()

while render_window.is_open:
	for event in render_window.events:
		if event.type == window.EventType.CLOSED:
			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(...)
  • event kinds use window.EventType
  • the event loop is exposed as render_window.events
  • module imports are the preferred style instead of a single monolithic namespace

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

GitHub Actions is centered on:

  • editable-install validation on Linux against a pinned SFML 2.6.2 build
  • packaging validation for both wheel and sdist artifacts
  • smoke-install checks on Linux, macOS, and Windows
  • curated typing validation using mypy
  • tag-driven wheel and sdist builds via cibuildwheel and python -m build

Release publishing is restricted to v* tags:

  • prerelease tags containing a, b, or rc publish to TestPyPI
  • other v* tags publish to PyPI

Release artifacts are validated before publish with .github/scripts/validate-dist.py and twine check, and the wheel builds run the deterministic wheel-safe pytest subset configured in pyproject.toml.

There is also a manual TestPyPI Validation GitHub Actions workflow for installing an already-uploaded TestPyPI version on fresh Linux, macOS, and Windows runners.

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/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-2.6.2.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

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

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

Uploaded CPython 3.13Windows x86-64

sfml-2.6.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sfml-2.6.2.0-cp313-cp313-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

sfml-2.6.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sfml-2.6.2.0-cp312-cp312-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

sfml-2.6.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sfml-2.6.2.0-cp311-cp311-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

sfml-2.6.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sfml-2.6.2.0-cp310-cp310-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for sfml-2.6.2.0.tar.gz
Algorithm Hash digest
SHA256 dfd90b8528b8bd266f73fad5d3efd6e1f6d8c816a0aab40284cfe068d283956f
MD5 bbb3a968bd944791f74a514ee517c1aa
BLAKE2b-256 86e9d6ceccc41f4d2aa5d7608a05af4f07ebea76667d667e339f091975733fc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sfml-2.6.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-2.6.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2267adcaa95d4f0a64a7abfd0c15d7aa93271d0338cea4a4f35ee14737e30f6b
MD5 42ec7e9db318ddb5b935984a3308f278
BLAKE2b-256 635ce5fe3876901f309f2e67a971d8a6b6bc06e5afa3aee4e9636f2044e8d479

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b38beddc780f8e922b01c5154506eb6219c316f256af2fddcbc88caa2d396ebe
MD5 9ceee84434cc8ec261cdc6675768db08
BLAKE2b-256 f9ea4f2ea4ddb03d1fb94759c631a5bbec038db716cb9964d16cb4f855e0ebc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 149e852cafb091553ebf20bca20ae742f840b653b5cb34621df90d36fda7e54f
MD5 282d789d08aa379c7507bddb56c2c83a
BLAKE2b-256 67cb57017221c4e6718ec76da17f23320b32cc17931240f63a8ed875a3a5d3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sfml-2.6.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-2.6.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e36f85c837c4da41a8021a752429736872582144a6148bdc2586bc91930995be
MD5 c67ab3f48c79bfc39431e501d973b7fd
BLAKE2b-256 b835f6ac544d2d44c0c3291176a35acc1d1692135fd8b60b60b480010d3bbf22

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef62151020db62a6548e980f44c79c97718c49d02f20858502fb1a4ca47c1305
MD5 93ed7369110371f7607fdf07ff920cdb
BLAKE2b-256 a39f608e335a181ba7d02da690252e9e3387b61a61b20506f3facb65a42391b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8146bf2eb410af62cfa8e03d4f9fa79738f65266dd12cdf088ebb2d8dbe466a0
MD5 207687bdddf5034d180337a79c3c1357
BLAKE2b-256 6a2c3412cf7a30e4840e830e9f886771517ef53e76f45ca4dd063cc9d6f8cf97

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sfml-2.6.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-2.6.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a8c683330f3570efe8fbceac9e31b148e9bce18f50fd099ad53b928d66f49091
MD5 abbaac1afaa5c3dcecb6e0a03e0e487c
BLAKE2b-256 6348ffe1ec0b1d3609a62eabaa53350820461c231973a1102512b2014c4fb70f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25c8e28fce2f27ac9c4092c81a9cff41cfd93fa05f2c400c0bcdd361e8a1f17e
MD5 ed33c43807e289eb7bc02956ca701360
BLAKE2b-256 0c0fdd12e2e6da7fba40e9f547921f87c20e369b9c935efa58af2c68bbe909ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3571f18f7baa9233a460181d9a0c5ed74e7d3a08ed921079ca6d60c4e99ffc4b
MD5 fd808445a264b06518cb5422d5d2cae2
BLAKE2b-256 901a4191140db7f92a88c6466eba458bd7e90c86362b74b391267fbb803bf25f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sfml-2.6.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-2.6.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 91d92f1224640040ab929deeb866cdf6a55dfa89959a7c2d368b0d8d8479dc6c
MD5 56ee46e082a689a7c51f363d1133380e
BLAKE2b-256 9a6feae4539c7807cfaa4cdbd96e5d252051b4dc8df852115138be1a4d859d8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 378a5827610cbb0c266767a4f20af9a096b19a7409476af64d89ce464c5bb996
MD5 8589591143b77a6e48df7bf4460c91e4
BLAKE2b-256 a4cfb42e11629aacaad0a30fcc8e9b9d9e782937a3d80fd0149bcbe7e5608af6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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-2.6.2.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for sfml-2.6.2.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3c0e148f3492eb4bb96c813230517dc50b85e2a57a8b2455485639e96381c604
MD5 cd92f8793f09a2aba6a9af13fa776f36
BLAKE2b-256 8e441bb49166940220864e9819358f104ae269164232402c6c101e05e1a8e5d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sfml-2.6.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