Skip to content

Instantly share code, notes, and snippets.

View jph00's full-sized avatar
🦘
roo

Jeremy Howard jph00

🦘
roo
View GitHub Profile

Building Hypermedia Apps with FastHTML

πŸ§‘ human (Sep 5, 2024, 02:05 PM)

How can FastHTML help me write Hypermedia applications?

πŸ€– assistant (Sep 5, 2024, 02:05 PM)

FastHTML is designed to help you write hypermedia applications efficiently by providing a framework that aligns closely with hypermedia principles. Here are some key ways FastHTML can assist:

  1. Simplified routing and handlers: FastHTML allows you to create routes using concise decorators:

Hypermedia Systems: book summary

This is a summary of "Hypermedia Systems" by Carson Gross, Adam Stepinski, Deniz Akşimşek. Summary created by Jeremy Howard with AI help.

  • Website for the book
  • The revolutionary ideas that empowered the Web
  • A simpler approach to building applications on the Web and beyond with htmx and Hyperview
  • Enhancing web applications without using SPA frameworks

1: Hypermedia: A Reintroduction

@jph00
jph00 / starlette-quick.md
Last active December 9, 2024 20:44
Starlette Quick Manual for FastHTML users

🌟 Starlette Quick Manual

2020-02-09

Starlette is the ASGI web framework used as the foundation of FastHTML. Listed here are some Starlette features FastHTML developers can use directly, since the FastHTML class inherits from the Starlette class (but note that FastHTML has its own customised RouteX and RouterX classes for routing, to handle FT element trees etc).

Get uploaded file content

@jph00
jph00 / run_coro.py
Created August 28, 2024 08:48
A possibly useful async2sync convertor
import asyncio
from inspect import iscoroutine, isasyncgen
from concurrent.futures import ThreadPoolExecutor
import nest_asyncio
nest_asyncio.apply()
def _iter_coro(r):
loop = asyncio.get_event_loop()
if loop.is_running():
@jph00
jph00 / pep517-warning.md
Last active August 27, 2024 14:31
Adding a minimal pyproject.toml - Claude chat

πŸ§‘ human (Aug 28, 2024, 12:01 AM)

DEPRECATION: Legacy editable install of coreg[dev]==0.14.0 from file:///... (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at pypa/pip#11457

I just started getting the above error when I pip install -e . of one of my own packages. I maintain a number of libs that I want people to be able to do editable installs of. I'd rather not require users add extra flags when doing editable installs of them. pyproject.toml doesn't support the features I need, so I have to use setup.py. Is there a way I can set this up?

πŸ€– assistant (Aug 28, 2024, 12:01 AM)

To address this issue while maintaining compatibility and ease of use for your users, y

@jph00
jph00 / understanding_fasthtml.md
Last active August 29, 2025 19:32
Understanding FastHTML Components and Architecture - a Claude Conversation

Understanding FastHTML Components and Architecture

πŸ§‘ human (Aug 26, 2024, 03:52 PM)

What are the components of FastHTML, and how do they work together? What are some key things I need to understand to write idiomatic FastHTML apps?

πŸ€– assistant (Aug 26, 2024, 03:52 PM)

Based on the documentation provided, here are the key components of FastHTML and how they work together to create web applications:

  1. Core Components:
@jph00
jph00 / starlette-sml.md
Created August 25, 2024 23:22
Starlette docs subset

index.md


Starlette Introduction

Starlette is a lightweight [ASGI][asgi] framework/toolkit, which is ideal for building async web services in Python.

It is production-ready, and gives you the following:

@jph00
jph00 / html_to_markdown_conversion_test.md
Created August 21, 2024 04:11
Gist created from web2md

HTML to Markdown Conversion Test

Text Formatting

This paragraph contains bold text , italic text , and inline code.

Lists

Unordered List

@jph00
jph00 / discord-interact.md
Created August 18, 2024 18:41
Discord Interactions

Discord Interactions

An Interaction is the message that your application receives when a user uses an application command or a message component.

For Slash Commands, it includes the values that the user submitted.

For User Commands and Message Commands, it includes the resolved user or message on which the action was taken.

For Message Components it includes identifying information about the component that was used. It will also include some metadata about how the interaction was triggered: the guild_id, channel, member and other fields. You can find all the values in our data models below.

@jph00
jph00 / discord-app-user.md
Created August 18, 2024 18:03
Developing A User-Installable Discord App

Developing A User-Installable Discord App

Discord apps can be installed to servers, users, or both. This guide will walk you through building a basic game integration app that is installable to both Discord users and servers.

While the tutorial will focus on supporting different installation contexts, we'll be building a basic game integration along the way with a wiki lookup with user-specific bookmarking and a server leaderboard. The app has four commands (/link, /profile, /leaderboard, and /wiki) that can be run in different installation and interaction contexts (which are concepts we'll dig into later in the tutorial).

Resources used in this guide

Overview of the tools and technologies we'll use