Skip to main content

Python SDK for Vercel

Project description

Vercel Python SDK

Python SDK for Vercel APIs and Vercel Functions.

For product-level behavior, limits, and platform setup, use the official Vercel docs.

Getting Started

Install the package:

pip install vercel

Or with uv:

uv add vercel

Configure the credentials via environment variables based on your app's needs:

  • BLOB_READ_WRITE_TOKEN for Vercel Blob
  • VERCEL_TOKEN, VERCEL_PROJECT_ID, and VERCEL_TEAM_ID for Vercel API clients
  • VERCEL_OIDC_TOKEN for local OIDC testing. On Vercel, OIDC helpers can read the request token after you register request headers with vercel.headers.set_headers().

For local OIDC development, you can load a short-lived token dynamically with the Vercel CLI:

VERCEL_OIDC_TOKEN=$(vc project token some-project) some-command

Usage

import asyncio

from vercel.client import AsyncVercel
from vercel.oidc.credentials import get_credentials


async def main() -> None:
    credentials = get_credentials()
    vercel = AsyncVercel(access_token=credentials.token)
    deployment = await vercel.deployments.create_deployment(
        body={
            "name": "hello-python",
            "project": "hello-python",
            "target": "preview",
            "files": [
                {
                    "file": "index.html",
                    "data": "<h1>Hello from Python</h1>",
                }
            ],
        }
    )

    print(f"Deployment created: https://{deployment['url']}")


asyncio.run(main())

Public API Vs Internals

Import from public modules under vercel.*, such as vercel.blob, vercel.cache, vercel.headers, vercel.oidc, vercel.projects, and vercel.sandbox. Modules under vercel._internal.* are implementation details and may change without public API guarantees.

Sync counterparts are available for the main client classes and module-level helpers when you are not running an async application.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vercel-0.5.9.tar.gz (119.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vercel-0.5.9-py3-none-any.whl (140.9 kB view details)

Uploaded Python 3

File details

Details for the file vercel-0.5.9.tar.gz.

File metadata

  • Download URL: vercel-0.5.9.tar.gz
  • Upload date:
  • Size: 119.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vercel-0.5.9.tar.gz
Algorithm Hash digest
SHA256 88d2c27ecf7e02de67b711d4dd9df84e70c6ae1823c09f1fd67146e3d54be462
MD5 dca7b1365dc826f43e5f01d239771eb4
BLAKE2b-256 53e986d6780301e36ecfe45ec401212593f24c555b284b5b080ac9a6253803ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for vercel-0.5.9.tar.gz:

Publisher: publish.yml on vercel/vercel-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vercel-0.5.9-py3-none-any.whl.

File metadata

  • Download URL: vercel-0.5.9-py3-none-any.whl
  • Upload date:
  • Size: 140.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vercel-0.5.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f87a354fc110f04f3d6a2270c800cd8d42a763ea116b2625fc049d54a856a31b
MD5 15fbb2ef101dc4ce2caa3df0e3bc952b
BLAKE2b-256 c20edc0cb599036ff3055428459a427ed895e1a4cd3db387655672c5d2dba04b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vercel-0.5.9-py3-none-any.whl:

Publisher: publish.yml on vercel/vercel-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page