vercel-headers
Request header helpers for Vercel Python applications
What it is and what it does
vercel-headers is a lightweight utility for Vercel Python applications that centralizes request header handling. It stores headers once per request and exposes them through a shared context that other helpers (OIDC, cache) can access. The package provides convenience methods to extract IP addresses and geolocation information from the registered headers.
The package is designed for serverless functions running on Vercel's platform where you need consistent access to request metadata across your application logic. It has no external runtime dependencies, making it a minimal addition to your project. The API is straightforward: call set_headers() early in your request handler, then use the exposed helpers to retrieve IP and location data as needed.
Use it for:
- Extract client IP address in Vercel functions for logging, rate limiting, or access control.
- Retrieve geolocation data from request headers to customize responses by region.
- Share request context across multiple helper modules (OIDC, cache) without passing headers repeatedly.
- Build request-scoped middleware that needs consistent header access throughout the request lifecycle.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Registers and exposes request headers for Vercel Python functions, providing helpers to extract IP addresses and geolocation data from the request context.
Yes, if you are building Python applications on Vercel and need to work with request headers and geolocation. The package is actively maintained, has no dependencies, and carries a permissive license. It solves a real problem for Vercel-specific development with minimal friction. Not relevant for non-Vercel deployments.
Install
vercel-headers on PyPI
pip
pip install vercel-headersuv
uv add vercel-headerspoetry
poetry add vercel-headersInstalling vercel-headers
Before you install
Low friction install with no runtime dependencies. Active maintenance status and recent releases (latest 29 days old) suggest ongoing support.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
Quickstart
pip install vercel-headers
from vercel.headers import set_headers
set_headers(request.headers)
Requires Python 3.10 or later.
Verify before relying
- Whether geolocation data is derived from Vercel's infrastructure or requires external services.
- What specific IP address extraction methods are available (e.g., client IP vs. proxy detection).
- How the OIDC and cache helpers mentioned in the description integrate with this package.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 29 days since the last release |
| First released | |
| Downloads | 1,189,542/month — #4,242 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vercel_headers-0.7.1-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
vercelPython SDK for Vercel that provides modules for…
permissive · top 5,000 on PyPI
vercel-oidcRetrieves, decodes, and verifies Vercel OIDC…
permissive · top 5,000 on PyPI
python-ipwareExtracts a client's IP address from web request…
permissive · top 5,000 on PyPI
vercel-cacheProvides runtime cache helpers for Vercel…
permissive · top 5,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
vercel_blobA Python client for uploading, downloading,…
unclear · top 15,000 on PyPI
django-ipwareRetrieves the client's IP address from a Django…
permissive · top 5,000 on PyPI
cached-ipaddressCaches IP address object construction and…
permissive · top 15,000 on PyPI
django-xffDjango middleware that extracts the real client…
permissive · top 15,000 on PyPI
ipinfoQueries the IPinfo.io API to retrieve…
permissive · top 15,000 on PyPI