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.0

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.0
File Size Uploaded Provenance Actions
veil_api_kit-0.10.0.tar.gz 30.1 kB With provenance Details for veil_api_kit-0.10.0.tar.gz

Built distribution (wheel)

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

Total release size: 60.1 kB

Release files / veil_api_kit-0.10.0.tar.gz

Download URL veil_api_kit-0.10.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ef66e9a38c88cf1bddd80fc9ca76bd0f11c3dbe788956c17b926d49d2f3d3d6b
BLAKE2b-256 checksum
How to use checksums
aabee26b8dcd4f037c993d80f3fb6ef2ac41ee64092c686d13251f376e594c2b
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 3, 2026.

Transparency log

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

Download URL veil_api_kit-0.10.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6a426aa7a22c795f34949b364c6f154d9ad902a11c6a86c81942ec2802b6b6b
BLAKE2b-256 checksum
How to use checksums
1e11fa6fd9b9189bc634242affe54dd1ed22d0bef73184763db71c7ae6c2317b
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 3, 2026.

Transparency log

Security for veil-api-kit 0.10.0

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.0.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 3, 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