An easy-to-use Python wrapper for the Vulkan API registry.
Project description
Vulkan Object Python Package
Parsing the vk.xml in Vulkan is easy, processing it is hard!
It is very easy for people to mess up trying to process the vk.xml file, so we created VulkanObject
VulkanObject is just a python dataclass that is defined in Vulkan-Headers/registry/vulkan_object.py. It uses the reg.py framework that the Vulkan Spec is generated with in order to populate the VulkanObject data structure.
This python package makes it super easy to get going.
pip install vulkan-object
and then it is as simple as
#!/usr/bin/env python3
from vulkan_object import get_vulkan_object
# This builds the VulkanObject that is populated and ready to be used
vk = get_vulkan_object()
print(f'There are now {len([x for x in vk.extensions.values()])} extensions in Vulkan')
print(f'Built with the {vk.headerVersion} headers')
longest_count = 0
for struct in vk.structs.values():
if len(struct.name) > longest_count:
longest_count = len(struct.name)
longest_struct = struct
print(f'Longest Struct name is {longest_struct.name} at {longest_count} characters')
Quick query from the terminal
Just run the following and you can quickly use vk in your terminal for some quick query
python -i -c "from vulkan_object import get_vulkan_object;vk = get_vulkan_object()"
Vulkan Video
Added in 1.4.342 release
By default, the video.xml file is not parsed, but can be turned on. (example: video_example.py)
vk = get_vulkan_object(video=True)
More example
example.py has more in depth ways to use this
What is this package/repo actually?
The Vulkan-Headers contain a bunch of scripts in the Vulkan-Headers/registry/ directory that repos can use to help generate code.
The main issue is the delivery mechanism for python projects. This package/repo just grabs the Vulkan-Headers scripts (not the C header files themselves!) and make it easier to integrate with projects.
Updating this repo
run python update.py /path/to/Vulkan-Headers and it will do everything to sync this package up with the new headers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vulkan_object-1.4.342.tar.gz.
File metadata
- Download URL: vulkan_object-1.4.342.tar.gz
- Upload date:
- Size: 372.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fb215526d238b0e4b913290942ad720d36b8ee150bb8bfa2c763e1c8d09eef
|
|
| MD5 |
a39750910041585da4ddee42e9c93d37
|
|
| BLAKE2b-256 |
f1ea008a237bf75d434050cf999a11d5e5c9fac9523979d883b26f4979a4efbe
|
Provenance
The following attestation bundles were made for vulkan_object-1.4.342.tar.gz:
Publisher:
publish.yml on KhronosGroup/vulkan-object
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vulkan_object-1.4.342.tar.gz -
Subject digest:
33fb215526d238b0e4b913290942ad720d36b8ee150bb8bfa2c763e1c8d09eef - Sigstore transparency entry: 872344439
- Sigstore integration time:
-
Permalink:
KhronosGroup/vulkan-object@f2a73a8daa1dfd6171f3cc0a11a41352ea33c04b -
Branch / Tag:
refs/tags/v1.4.342 - Owner: https://github.com/KhronosGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2a73a8daa1dfd6171f3cc0a11a41352ea33c04b -
Trigger Event:
release
-
Statement type:
File details
Details for the file vulkan_object-1.4.342-py3-none-any.whl.
File metadata
- Download URL: vulkan_object-1.4.342-py3-none-any.whl
- Upload date:
- Size: 381.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
006d975dccb1f5baff2b1a95675b02ca01588247fc98f9212cfaa91be7caccb2
|
|
| MD5 |
8f4a303b5fac476fb70ccb6fbea97e01
|
|
| BLAKE2b-256 |
9a5367fa2c65adbb9d468418d17da2ee3200dfb799b008d5a90f3f6d0db9024d
|
Provenance
The following attestation bundles were made for vulkan_object-1.4.342-py3-none-any.whl:
Publisher:
publish.yml on KhronosGroup/vulkan-object
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vulkan_object-1.4.342-py3-none-any.whl -
Subject digest:
006d975dccb1f5baff2b1a95675b02ca01588247fc98f9212cfaa91be7caccb2 - Sigstore transparency entry: 872344457
- Sigstore integration time:
-
Permalink:
KhronosGroup/vulkan-object@f2a73a8daa1dfd6171f3cc0a11a41352ea33c04b -
Branch / Tag:
refs/tags/v1.4.342 - Owner: https://github.com/KhronosGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2a73a8daa1dfd6171f3cc0a11a41352ea33c04b -
Trigger Event:
release
-
Statement type: