Skip to main content

veil-api-kit

Helpers for veil-api applications (import veil_kit). It is a pure-Python package with the same version as veil-api. Optional dependencies come with extras:

pip install veil-api-kit                     # cookies, sessions, CORS, security, static files, DI, tasks
pip install "veil-api-kit[jwt]"              # JWT (PyJWT)
pip install "veil-api-kit[graphql]"          # GraphQL (strawberry)
pip install "veil-api-kit[grpc]"             # gRPC client and server helpers (protobuf)
pip install "veil-api-kit[grpcio]"           # + grpcio and grpcio-tools (code generation, grpc.RpcError)
pip install "veil-api-kit[redis]"            # Redis session store
pip install "veil-api-kit[cron]"             # croniter (more cron syntax)
pip install "veil-api-kit[all]"
Module What it does
veil_kit.cookies Signed cookies (itsdangerous-compatible format, key rotation)
veil_kit.sessions Cookie sessions (Starlette SessionMiddleware format) and server-side stores (memory, Redis)
veil_kit.cors CORSMiddleware with Starlette's arguments, answered natively by the server
veil_kit.security HTTPBasic, HTTPBearer, APIKeyHeader, OAuth2PasswordBearer, OAuth2PasswordRequestForm, JWT
veil_kit.redirects safe_redirect: redirect only to this site or to listed hosts
veil_kit.staticfiles StaticFiles(directory=...) served by the server's file backend (sendfile)
veil_kit.graphql strawberry schemas over HTTP, SSE and WebSocket, with GraphiQL
veil_kit.grpc A channel for grpc_tools stubs (sync and grpc.aio style), server helpers
veil_kit.di A dependency injection container (singleton, scoped, transient)
veil_kit.tasks Periodic, cron and resident tasks
veil_kit.testing TestClient and dependency overrides

Example

import veil
from veil_kit.cors import CORSMiddleware
from veil_kit.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm, JWT
from veil_kit.staticfiles import StaticFiles

app = veil.App()
app.add_middleware(CORSMiddleware, allow_origins=["https://app.example.com"])
app.mount("/static", StaticFiles(directory="public"))

oauth2 = OAuth2PasswordBearer(tokenUrl="/token")
tokens = JWT(secret="change-me")

@app.post("/token")
def token(form: OAuth2PasswordRequestForm = veil.Depends()):
    if form.password != "secret":
        raise veil.HTTPException(400, "bad credentials")
    return {"access_token": tokens.encode({"sub": form.username}), "token_type": "bearer"}

def current_user(token: str = veil.Depends(oauth2)):
    return tokens.decode(token)["sub"]

@app.get("/me")
def me(user: str = veil.Depends(current_user)):
    return {"user": user}

app.run(listen_cleartext="127.0.0.1:8000")

Documentation: https://veil-api.readthedocs.io (the "Kit" and "FastAPI compatibility" pages).

License: Apache-2.0 OR MIT.

Metadata

Release files for veil-api-kit 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veil-api-kit 0.10.1
File Size Uploaded Provenance Actions
veil_api_kit-0.10.1.tar.gz 30.1 kB With provenance Details for veil_api_kit-0.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veil-api-kit 0.10.1
File Interpreter ABI Platform Actions
veil_api_kit-0.10.1-py3-none-any.whl Python 3 none any Details for veil_api_kit-0.10.1-py3-none-any.whl

Total release size: 60.1 kB

Release files / veil_api_kit-0.10.1.tar.gz

Download URL veil_api_kit-0.10.1.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eb809bac3e51dd32ab3155b7752a670dce3c325f0e1b92ffce1ec001a46e408d
BLAKE2b-256 checksum
How to use checksums
18a3a0f4b4ccd84bc8a53f492ab1e73ce32f101b204e791941505590f5e519af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / veil_api_kit-0.10.1-py3-none-any.whl

Download URL veil_api_kit-0.10.1-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b93e5f89a13ed0fe2f948e404aab4e3868e2278ebf9881ab5cdf5d415a6cb2a
BLAKE2b-256 checksum
How to use checksums
f41ca672fb33278cad17fa381eb6e38287694dcedc733024c46cde1dc7220e46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for veil-api-kit 0.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for veil_api_kit-0.10.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page