pyD2D - A Python wrapper for the Windows Direct2D API
pyD2D is a Python wrapper for the Windows Direct2D and DirectWrite APIs.
Note: Not all of the Direct2D and DirectWrite APIs are wrapped, but the most commonly used ones are. If you need a specific API that is not wrapped, feel free to open an issue or submit a pull request.
Installation
pip install pyd2d
Usage
See the demo app for a working example app using pyD2D and ctypes.
Basic usage is as below:
import pyd2d
# Initialize COM
pyd2d.InitializeCOM()
# Create a Direct2D factory
factory = pyd2d.GetD2DFactory()
# Create a render target
render_target = factory.CreateHwndRenderTarget(
my_hwnd, width=800, height=600,
)
# Draw a rectangle
render_target.BeginDraw()
render_target.Clear(1.0, 1.0, 1.0, 1.0)
render_target.FillRectangle(
100, 100, 200, 200,
render_target.CreateSolidColorBrush(0.0, 0.0, 0.0, 1.0),
)
render_target.EndDraw()
# Release resources
render_target.Release()
factory.Release()
pyd2d.UninitializeCOM()
License
pyD2D is licensed under the MIT License.
Metadata
Release files for pyd2d 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 | Provenance | Actions |
|---|---|---|---|---|
| pyd2d-0.2.0.tar.gz | 15.8 kB | With provenance | Details for pyd2d-0.2.0.tar.gz |
Built distributions (wheels)
Total release size: 1.4 MB
Release files / pyd2d-0.2.0.tar.gz
| Download URL | pyd2d-0.2.0.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1cdbbe179add9c019dc77052299951a2f4710eec858f1b7179ae1f2e6ff32b7
|
|
BLAKE2b-256 checksum How to use checksums |
071957d87eb19c3e69bf9fe0e8196565a76044439a197280d0d5bf25ca1a4a8f
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp314-cp314t-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 101.2 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4bb6f21f93a732c5f268c12a621bfb0e4f75f1f9462a694beb8f4d0efe8458a6
|
|
BLAKE2b-256 checksum How to use checksums |
aacfce6a58ded32d8f82ca2bee3a782d3183c734186f641a1953fe2242300d92
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp314-cp314t-win32.whl
| Download URL | pyd2d-0.2.0-cp314-cp314t-win32.whl |
|---|---|
| Size | 85.2 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-32 |
|
SHA-256 checksum How to use checksums |
152f055095c2466d78ddab0d83e35a33905011d36523dea07b66b548070ac609
|
|
BLAKE2b-256 checksum How to use checksums |
1b644e85a4515f48c3d5937937cec8e35e32da06eddd846851743a46ca135100
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp314-cp314-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 91.1 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6c0f76f3fceea532697c532608ed104c723b050db46b623e7d4517c5cd31575f
|
|
BLAKE2b-256 checksum How to use checksums |
8dfc941f0392deeab856cd48ed3789e170aa8fa720de3b667b23295974fb7f0a
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp314-cp314-win32.whl
| Download URL | pyd2d-0.2.0-cp314-cp314-win32.whl |
|---|---|
| Size | 78.2 kB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
3dd9cc2c215c467782908a811a4a8a498f0f9bbbc410aeb7029ae5e3dccc42ff
|
|
BLAKE2b-256 checksum How to use checksums |
de95280862716ed35834b60c57c5d879d74fb2dbf7a64f96212dd1fcf1d1bbe8
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp313-cp313t-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp313-cp313t-win_amd64.whl |
|---|---|
| Size | 96.3 kB |
| Tags | CPython 3.13 CPython 3.13 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
182c1edf86b2c157a7ed15600609dc40dde6898cd3e621395b10c213d5be8955
|
|
BLAKE2b-256 checksum How to use checksums |
997789c6c31b23a20445735808b2d9798dba9fc49b73141bd34b709d4c060a91
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp313-cp313t-win32.whl
| Download URL | pyd2d-0.2.0-cp313-cp313t-win32.whl |
|---|---|
| Size | 82.4 kB |
| Tags | CPython 3.13 CPython 3.13 free-threading Windows x86-32 |
|
SHA-256 checksum How to use checksums |
414126228358637c7e57eb871cce9acfcb0cdc285b564fad69178850a632afbd
|
|
BLAKE2b-256 checksum How to use checksums |
5afe50315c966a24a1c2b933e6d1fb4b6fc69cdfbe80b0e634462cc98200c0b9
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp313-cp313-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 88.9 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
04a811f82e750bdd1413b0d3a99297f208807f41777160bce6bc7209d7ff0a5c
|
|
BLAKE2b-256 checksum How to use checksums |
dc3be4bb5f209e45dcf2151e513b43a222ba6f25f913cf6781a260d2b725e0f6
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp313-cp313-win32.whl
| Download URL | pyd2d-0.2.0-cp313-cp313-win32.whl |
|---|---|
| Size | 76.5 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f6ebd0c4cd6c0eae6f16bc26df2052ec57e0e890bb8b2f4b62bbc70e2fbe51cf
|
|
BLAKE2b-256 checksum How to use checksums |
34596a4d9a03f379ebc88cb7ecae8c54a5ede1699fdb00bd3c5503e45301b9eb
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 88.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f3ea2b42d523eb91d9ae694ae67a9ab3a8cae140ef3f6b79c09a2b0e112e4541
|
|
BLAKE2b-256 checksum How to use checksums |
93768780c7402eae68d7d8a508a29d4e9756a9b474a8aff109a0a490fef4ffd0
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp312-cp312-win32.whl
| Download URL | pyd2d-0.2.0-cp312-cp312-win32.whl |
|---|---|
| Size | 80.3 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
6542a7328388d6ffc38d598131469bbfa0e926d1790c68be58ae70645c927fe5
|
|
BLAKE2b-256 checksum How to use checksums |
a6ec7f47cb91cea46d98387d7444d27e293356ed4a1e448c2ab5cd673f29746d
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 89.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e8caa38cc936f78cfc44ca572b410f27df36f7d9b9c8e539d4a837352418be3a
|
|
BLAKE2b-256 checksum How to use checksums |
438df51a89fcb4772c3d8889f03b7d243d30065237fd08d12b43457d9fb88d4f
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp311-cp311-win32.whl
| Download URL | pyd2d-0.2.0-cp311-cp311-win32.whl |
|---|---|
| Size | 81.5 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c999d3ea7c38ca79c32a5ea10e4d175be03e890d1759415c602c50a29b7c9da1
|
|
BLAKE2b-256 checksum How to use checksums |
9eac1941bfe6c5336da3dae5922cbc4a6456c939138bdc80d6b1ea869a816554
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp310-cp310-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 89.0 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6a725170532dd8b099972356d0f80827510e41d1878aa000b4b77d92302551bf
|
|
BLAKE2b-256 checksum How to use checksums |
06c5c17da414504b18ecb10256ac4cebf4e08f609b7b559f63da971dcd093e60
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp310-cp310-win32.whl
| Download URL | pyd2d-0.2.0-cp310-cp310-win32.whl |
|---|---|
| Size | 81.2 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c0cd89d9d5d6bec6f3b8f6b37a2f00718e41c2f76dbf7e33ef65334dc161879b
|
|
BLAKE2b-256 checksum How to use checksums |
f4aac4dbe1fccd6ed79bd6ca11370940a3762dba72cfc2c23d6297c921810dff
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp39-cp39-win_amd64.whl
| Download URL | pyd2d-0.2.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 89.3 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cdc4e65aaa1f2fc7ce2f7ff8796227fcf05288c9316fdefc6e40d3f2f137c1ea
|
|
BLAKE2b-256 checksum How to use checksums |
2367a37c6f1f6cde377cb93dee41dcdf3928e1f11fc0be6850e7bc8f87eb867f
|
| 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 Nov 4, 2025.
Transparency logRelease files / pyd2d-0.2.0-cp39-cp39-win32.whl
| Download URL | pyd2d-0.2.0-cp39-cp39-win32.whl |
|---|---|
| Size | 81.4 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
51435b0ddd33081e89d26c54169512d046dbba7450a29dc2ec9f4540938c283d
|
|
BLAKE2b-256 checksum How to use checksums |
c837149826ad59b21182a7b206a6dc978590a2d6e3eb82d0955d7c076aa4555e
|
| 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 Nov 4, 2025.
Transparency logSecurity for pyd2d 0.2.0
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.
Full provenance
All 17 files in this release have been uploaded with provenance metadata.
Attestation for pyd2d-0.2.0.tar.gz
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 Nov 4, 2025.
Transparency logA 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.