Skip to main content

FASTAPI REDIS

USAGE

from fastapi_redis import (
    FastAPIRedis,
    FastAPIAsyncRedis
)
from fastapi_redis.types import (
    RedisClient,
    AsyncRedisClient,
    FastAPIAsyncRedis,
    FastAPIRedis
) 
from fastapi import (
    FastAPI,
    Depends
)

app = FastAPI()

redis = FastAPIRedis(
    host="127.0.0.1",
    port="6379"
)

async_redis = FastAPIAsyncRedis(
    host="127.0.0.1",
    port="6379"
)

# In Depends
@app.get("/")
def get(
    rd: RedisClient = Depends(redis.get_connection)  
):
    rd.get("test")
    
    
@app.get('/')
async def get(
    rd: AsyncRedisClient = Depends(async_redis.get_connection)
):
    await rd.get("test")

    
# Outside of Depends
@app.get("/")
def get():
    conn: RedisClient
    with redis.get_connection_() as conn:
        conn.get("test")
    
@app.get("/")
async def get():
    conn: AsyncRedisClient
    async with async_redis.get_connection_() as conn:
        await conn.get("test")

Metadata

Release files for fastapi-redis-vet1ments 0.2.6

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

Source distribution (sdist)

Source distribution for fastapi-redis-vet1ments 0.2.6
File Size Uploaded Provenance Actions
fastapi_redis_vet1ments-0.2.6.tar.gz 4.5 kB Without provenance Details for fastapi_redis_vet1ments-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-redis-vet1ments 0.2.6
File Interpreter ABI Platform Actions
fastapi_redis_vet1ments-0.2.6-py3-none-any.whl Python 3 none any Details for fastapi_redis_vet1ments-0.2.6-py3-none-any.whl

Total release size: 10.0 kB

Release files / fastapi_redis_vet1ments-0.2.6.tar.gz

Download URL fastapi_redis_vet1ments-0.2.6.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b714b306551de786649d3a20290967673fa90fdb2f0439d38eed07aa399132f6
BLAKE2b-256 checksum
How to use checksums
ae2da37bf79edfc7abf31f5768fbe79b25c8d891e94aff36cfa7ef6b6b84df9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / fastapi_redis_vet1ments-0.2.6-py3-none-any.whl

Download URL fastapi_redis_vet1ments-0.2.6-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbe4417b67f11c20c59a5a86cc9a581512abaacbbda770147b26053f447788ab
BLAKE2b-256 checksum
How to use checksums
51bcb36ded9924d1c1e49a7e7b3daafeb5b83934281c97f249daaec3f16c0e16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for fastapi-redis-vet1ments 0.2.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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