#python

3 posts

Python asynccontextmanager & FastAPI Lifespan Pattern

How @asynccontextmanager and yield divide startup/shutdown in FastAPI lifespan, and how dunder methods __aenter__/__aexit__ work as Python's context manager protocol.

PDF RAG Indexing: Unit Detection and Chunk Noise Filtering

How to reliably detect structured unit boundaries in a bilingual PDF and prevent boilerplate text from polluting RAG vector chunks.

Supabase Auth + FastAPI JWT Verification: HS256 → ES256 Migration

New Supabase projects sign JWTs using the ES256 algorithm. How to verify with PyJWT + JWKS client and how to resolve macOS Python SSL issues.