Skip to main content

Python bindings for hyprlang configuration parser

Project description

hyprlang-pybind

Python bindings for hyprlang, the configuration language used by Hyprland and other Hypr projects.

Built with pybind11, providing both a high-level Pythonic API and a low-level API that mirrors the C++ interface.

Quick Start

import hyprlang_pybind as hyprlang

data = hyprlang.parse_string("""
general {
    border_size = 3
    gaps_in = 5.0
    layout = dwindle
}
""")

print(data["general"]["border_size"])  # 3
print(data["general"]["gaps_in"])      # 5.0
print(data["general"]["layout"])       # "dwindle"

Schema is optional. When omitted, keys and types are auto-inferred from the config contents. You can also provide an explicit schema for precise type control:

data = hyprlang.parse_file("/path/to/config.conf", schema={
    "general": {
        "border_size": 0,
        "gaps_in": 0.0,
        "layout": "",
    },
})

Documentation

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

hyprlang_pybind-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file hyprlang_pybind-0.1.1.tar.gz.

File metadata

  • Download URL: hyprlang_pybind-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hyprlang_pybind-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d78ed00f20d20219365ec86d089753b778c50f41e331bef4ca14d2ea88242e11
MD5 da14e47e255fca4c8ddbc60609ffc96a
BLAKE2b-256 01861d2970125333dd335fdc5b07796ebe95256b635758bc849abed732820ae3

See more details on using hashes here.

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