Brand YAML Python Package

PyPI Python Tests MIT License

Installation

From PyPI

uv pip install brand_yml

From GitHub

uv pip install "git+https://github.com/posit-dev/brand-yml"

Example

from brand_yml import Brand

brand = Brand.from_yaml_str(
    # Typically, this file is stored in `_brand.yml`
    # and read with `Brand.from_yaml()`.
    """
    meta:
      name: Posit Software, PBC
      link: https://posit.co
    color:
      palette:
        pblue: "#447099"
        green: "#72994E"
        teal: "#419599"
        orange: "#EE6331"
        purple: "#9A4665"
        gray: "#707073"
      primary: blue
      secondary: gray
      success: green
      info: teal
      warning: orange
      danger: purple
    typography:
      base:
        family: Open Sans
        weight: 300
    """
)
brand.meta.name
BrandMetaName(full='Posit Software, PBC')
brand.color.primary
'blue'
brand.typography.base.model_dump()
{'family': 'Open Sans', 'weight': 300, 'size': None, 'line_height': None}