skillfed

vercel-headers

Request header helpers for Vercel Python applications

vercel-headers v0.7.1 1.2M downloads/30d#4,242 on PyPI
Permissive license MIT Active released

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-headers

uv

uv add vercel-headers

poetry

poetry add vercel-headers

Installing 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

vercel request headersvercel python helpersextract ip address vercelgeolocation from headersvercel function contextrequest header management
vercel-specificrequest-headers

More WWW/HTTP packages