Typed Python schema for every Hyprland configuration option
Project description
hyprland-schema
Typed Python schema for every Hyprland configuration option — with defaults, ranges, and descriptions. Generated from Hyprland's ConfigDescriptions.hpp. Zero runtime dependencies — stdlib only.
Installation
pip install hyprland-schema
Usage
import hyprland_schema
# Schema version
print(hyprland_schema.HYPRLAND_VERSION) # "v0.54.3"
# Lookup by key
border = hyprland_schema.OPTIONS_BY_KEY["general:border_size"]
print(border.type, border.default, border.min, border.max)
# int 1 0 20
# Filter by section
for opt in hyprland_schema.get_section("general"):
print(f"{opt.name}: {opt.type} = {opt.default}")
# Filter by subsection
for opt in hyprland_schema.get_subsection("decoration", "blur"):
print(f"{opt.name}: {opt.type} = {opt.default}")
# Iterate all options
for opt in hyprland_schema.OPTIONS:
print(f"{opt.key}: {opt.type}")
# Export as JSON
json_str = hyprland_schema.get_json()
Loading older Hyprland versions
import hyprland_schema
# List all bundled versions (newest first)
print(hyprland_schema.available_versions())
# Load schema for a specific version
schema = hyprland_schema.load("v0.54.2")
print(schema.version, len(schema.options))
# Schema objects have the same filtering API
for opt in schema.get_section("general"):
print(f"{opt.name}: {opt.type} = {opt.default}")
# Lookup on a Schema
border = schema.options_by_key["general:border_size"]
Resolution order for load():
- Latest bundled version — instant (pre-parsed).
- Older bundled version — reconstructed via reverse migrations.
- Disk cache at
~/.cache/hyprland-schema/— no network needed. - GitHub fetch — downloads
ConfigDescriptions.hppand parses it.
API
| Symbol | Type / Signature | Description |
|---|---|---|
HYPRLAND_VERSION |
str |
Hyprland tag the schema was built from |
OPTIONS |
tuple[HyprOption, ...] |
All configuration options |
OPTIONS_BY_KEY |
dict[str, HyprOption] |
Lookup by dotted key |
get_section(s) |
(str) -> list[HyprOption] |
Options in a top-level section |
get_subsection(s, sub) |
(str, str) -> list[HyprOption] |
Options in a nested subsection |
get_json() |
(*, indent=2) -> str |
Full schema as a JSON string |
load(version) |
(str) -> Schema |
Load schema for a specific Hyprland version |
available_versions() |
() -> list[str] |
All bundled versions, newest first |
MigrationError |
Exception |
Raised when a version migration fails |
Schema
Schema is a frozen dataclass returned by load(). It holds options for a
specific Hyprland version.
| Attribute / Method | Type / Signature | Description |
|---|---|---|
version |
str |
Hyprland version tag |
options |
tuple[HyprOption, ...] |
All options for this version |
options_by_key |
dict[str, HyprOption] |
Lookup by dotted key |
get_section(s) |
(str) -> list[HyprOption] |
Options in a top-level section |
get_subsection(s, sub) |
(str, str) -> list[HyprOption] |
Options in a nested subsection |
get_json() |
(*, indent=2) -> str |
Schema as a JSON string |
HyprOption fields
| Field | Type | Description |
|---|---|---|
key |
str |
"general:border_size" |
section |
tuple[str, ...] |
("general",) |
name |
str |
"border_size" |
description |
str |
Human-readable text |
type |
str |
bool, int, float, string, color, gradient, vec2, choice |
default |
Any |
Default value |
min |
int | float | None |
For int/float types |
max |
int | float | None |
For int/float types |
enum_values |
tuple[str, ...] | None |
For choice type |
default_str |
str | None |
Human-readable default for choice type |
default_min |
tuple[float, ...] | None |
For vec2 type |
default_max |
tuple[float, ...] | None |
For vec2 type |
Requirements
- Python >= 3.12
License
MIT
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
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 hyprland_schema-0.4.0.tar.gz.
File metadata
- Download URL: hyprland_schema-0.4.0.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e40e2dd2b1e7c568e6eed7fb5993ec4fe88b51a68846c4a6702b47e26e31522e
|
|
| MD5 |
b06d6ec6fbec5209e11adede1e4a7076
|
|
| BLAKE2b-256 |
8634c2a2738268c5fc3e56743493b85f05fc8afe6a9cc3503554af9284e70379
|
Provenance
The following attestation bundles were made for hyprland_schema-0.4.0.tar.gz:
Publisher:
publish.yml on BlueManCZ/hyprland-schema
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyprland_schema-0.4.0.tar.gz -
Subject digest:
e40e2dd2b1e7c568e6eed7fb5993ec4fe88b51a68846c4a6702b47e26e31522e - Sigstore transparency entry: 1189453244
- Sigstore integration time:
-
Permalink:
BlueManCZ/hyprland-schema@7d483c44e2a00dfd2952b30fcbb8b4de7ae33be3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/BlueManCZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d483c44e2a00dfd2952b30fcbb8b4de7ae33be3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hyprland_schema-0.4.0-py3-none-any.whl.
File metadata
- Download URL: hyprland_schema-0.4.0-py3-none-any.whl
- Upload date:
- Size: 31.8 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 |
92816b9056e29e846dfc9920cf64553b7fc0f809eedec2b9771955f0e5724a6e
|
|
| MD5 |
54381f0a3b8d4be08d02f2030db71ae9
|
|
| BLAKE2b-256 |
cb3ba73910d3faadd9fdbc888dd61e61074838b9e0895b2fea5d3752874ab545
|
Provenance
The following attestation bundles were made for hyprland_schema-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on BlueManCZ/hyprland-schema
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyprland_schema-0.4.0-py3-none-any.whl -
Subject digest:
92816b9056e29e846dfc9920cf64553b7fc0f809eedec2b9771955f0e5724a6e - Sigstore transparency entry: 1189453250
- Sigstore integration time:
-
Permalink:
BlueManCZ/hyprland-schema@7d483c44e2a00dfd2952b30fcbb8b4de7ae33be3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/BlueManCZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d483c44e2a00dfd2952b30fcbb8b4de7ae33be3 -
Trigger Event:
release
-
Statement type: