Skip to content

Instantly share code, notes, and snippets.

View williambdean's full-sized avatar
💻
Stuck in the terminal

Will Dean williambdean

💻
Stuck in the terminal
View GitHub Profile
@williambdean
williambdean / docs.py
Last active November 1, 2025 22:47
Automate marimo notebook as documentation
import marimo
__generated_with = "0.17.6"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
@williambdean
williambdean / new_method.py
Last active September 19, 2025 15:28
function decorator to extend polars with new method via dataframe namespace accessors
"""Example of adding new methods to Polars DataFrames using decorators and namespace accessors.
Examples
--------
Make a new method that doubles all values in a DataFrame:
.. code-block:: python
import polars as pl
@williambdean
williambdean / bot-prs.yml
Created March 3, 2025 18:45
Label PRs from Bots with "no releasenotes"
---
# See in action with pymc-labs/pymc-marketing: https://github.com/pymc-labs/pymc-marketing/blob/main/.github/workflows/bot-prs.yml
name: Bot PRs
on:
pull_request:
types: [opened]
permissions:
pull-requests: write
@williambdean
williambdean / Print python code.ipynb
Last active September 10, 2025 14:03
Print function python code from notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@williambdean
williambdean / config.py
Last active October 19, 2022 20:31
Using Pydantic to define and read in yaml configuration files. Provides built in config validation!
from yaml_base_model import YamlBaseModel
from pydantic import BaseModel
from typing import List
from enum import Enum
class Category(Enum):
GREETING: str = "Greeting"
CODE: str = "Code"