Skip to content

Instantly share code, notes, and snippets.

View swilcox's full-sized avatar
🎙️

Steven Wilcox swilcox

🎙️
View GitHub Profile
@swilcox
swilcox / lcd_display.py
Created March 9, 2025 17:10
simple lcd display script
import sys
from tm1637 import TM1637Display
# Define the GPIO pins connected to the TM1637 display
CLK_PIN = 23 # GPIO23
DIO_PIN = 24 # GPIO24
def main(display_str=""):
@swilcox
swilcox / main.py
Created May 12, 2025 22:26
litestar pydantic post endpoint model validation?
from pydantic import BaseModel
from litestar import Litestar, get, post
class Book(BaseModel):
id: int
title: str
author: str
@swilcox
swilcox / main.py
Created May 12, 2025 22:44
litestar pydantic post endpoint model validation?
from typing import Annotated
from pydantic import BaseModel, Field
from litestar import Litestar, get, post
class Book(BaseModel):
id: Annotated[int, Field(gt=0, lt=10000)]
title: str
author: str