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.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| veil_api_kit-0.11.0.tar.gz | 30.2 kB | With provenance | Details for veil_api_kit-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| veil_api_kit-0.11.0-py3-none-any.whl | Python 3 | none | any | Details for veil_api_kit-0.11.0-py3-none-any.whl |
Total release size: 60.3 kB
Release files / veil_api_kit-0.11.0.tar.gz
| Download URL | veil_api_kit-0.11.0.tar.gz |
|---|---|
| Size | 30.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91875998a971af8f59125488132c3dcec2c692dbc14f37299718981e21cb7620
|
|
BLAKE2b-256 checksum How to use checksums |
6e8ab7839fa5671112f225b1377502ce854b9c0a3944e1eacfe55c25c6f1ae7b
|
| 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 6, 2026.
Transparency logRelease files / veil_api_kit-0.11.0-py3-none-any.whl
| Download URL | veil_api_kit-0.11.0-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ad4490f98c563fdeed624b401f8eaeb1bbf855b4d397d0bd3c43d695e6eeffa
|
|
BLAKE2b-256 checksum How to use checksums |
c8d36f3f242ba1a273e28ff73108621df4d34e7195ccfb0d58821f87017ac197
|
| 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 6, 2026.
Transparency logSecurity for veil-api-kit 0.11.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.
Attestation for veil_api_kit-0.11.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 6, 2026.
Transparency logA 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.