Skip to content

Commit

Permalink
chore(py): Fill out readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Oct 21, 2024
1 parent 7c60e0d commit eaa74c7
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 15 deletions.
23 changes: 15 additions & 8 deletions docs/pkg/py/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,27 @@ uv pip install "git+https://github.com/posit-dev/brand-yml#subdirectory=pkg-py"
## Example

```{python}
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:
primary: "#447099"
secondary: "#707073"
success: "#72994E"
info: "#419599"
warning: "#EE6331"
danger: "#9A4665"
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
Expand Down
65 changes: 61 additions & 4 deletions pkg-py/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,74 @@
# brand.yml Python Package


Create reports, apps, dashboards, plots and more that match your
company’s brand guidelines with a single `_brand.yml` file.

**brand.yml** is a simple, portable YAML file that codifies your
company’s brand guidelines into a format that can be used by
[Quarto](https://quarto.org), Python and R tooling to create branded
outputs. Our goal is to support unified, branded theming for all of
[Posit’s open source tools](https://posit.co/products/open-source/)—from
web applications to printed reports to dashboards and presentations—with
a consistent look and feel.

With a single `_brand.yml` file you can collect brand logos, colors,
fonts and typographic choices, typically found in your company’s brand
guidelines. This `_brand.yml` can be used [Quarto](https://quarto.org)
and [Shiny for Python](https://shiny.posit.co/py) to instantly basic
themes that match the brand guidelines.

## Example

``` python
from brand_yml import Brand

brand = Brand(
meta = {"name": "Posit PBC", "link": "https://posit.co"}
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
"""
)
```

``` python
brand.meta.name
```

BrandMetaName(full='Posit Software, PBC')

brand.meta
``` python
brand.color.primary
```

'blue'

``` python
brand.typography.base.model_dump()
```

BrandMeta(name=BrandMetaName(full='Posit PBC'), link=BrandMetaLink(home=Url('https://posit.co/')))
{'family': 'Open Sans', 'weight': 300, 'size': None, 'line_height': None}

## Installation

Expand Down
51 changes: 48 additions & 3 deletions pkg-py/README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,61 @@ subtitle: "Unified Branding for Humans"
format: gfm
---

Create reports, apps, dashboards, plots and more that match your company's brand guidelines with a single `_brand.yml` file.

**brand.yml** is a simple, portable YAML file that codifies your company's brand guidelines into a format that can be used by [Quarto](https://quarto.org), Python and R tooling to create branded outputs.
Our goal is to support unified, branded theming for all of [Posit's open source tools](https://posit.co/products/open-source/)---from web applications to printed reports to dashboards and presentations---with a consistent look and feel.

With a single `_brand.yml` file you can collect brand logos, colors, fonts and typographic choices, typically found in your company's brand guidelines.
This `_brand.yml` can be used [Quarto](https://quarto.org) and [Shiny for Python](https://shiny.posit.co/py) to instantly basic themes that match the brand guidelines.

## Example

```{python}
from brand_yml import Brand
brand = Brand(
meta = {"name": "Posit PBC", "link": "https://posit.co"}
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
```{python}
brand.meta.name
```

```{python}
brand.color.primary
```

```{python}
brand.typography.base.model_dump()
```


## Installation

### From PyPI
Expand Down

0 comments on commit eaa74c7

Please sign in to comment.