FastAPI-Redis SDK Development
redis/fastapi-redis-sdk
Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.
Python Redis 模块快速集成技能。面向已拥有 FastAPI 项目骨架的开发者,提供 Redis 缓存、Session 存储、分布式锁、限流、消息队列等能力的快速集成。触发词:"Python Redis"、"FastAPI Redis"、"Redis 集成"、"redis cache"、"redis session"、"redis lock"、"redis 限流"、"redis…
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jiushiwon/wg-skills python-redis-module-skill --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .claude/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .claude/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skillType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jiushiwon/wg-skills python-redis-module-skill --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .agents/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .agents/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jiushiwon/wg-skills python-redis-module-skill --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .cursor/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .cursor/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jiushiwon/wg-skills.git --path vibeCoding/backend/python/fastapi-module/python-redis-module-skill--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jiushiwon/wg-skills python-redis-module-skill --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .gemini/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .gemini/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jiushiwon/wg-skills python-redis-module-skillInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .github/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .github/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jiushiwon/wg-skills python-redis-module-skill --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/vibeCoding/backend/python/fastapi-module/python-redis-module-skill .opencode/skills/python-redis-module-skill && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "python-redis-module-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/python-redis-module-skill into .opencode/skills/python-redis-module-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-redis-module-skill", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
python-redis-module-skillPython Redis 模块快速集成技能。面向已拥有 FastAPI 项目骨架的开发者,提供 Redis 缓存、Session 存储、分布式锁、限流、消息队列等能力的快速集成。触发词:"Python Redis"、"FastAPI Redis"、"Redis 集成"、"redis cache"、"redis session"、"redis lock"、"redis 限流"、"redis…
Python Redis Module Skill is an agent skill from jiushiwon/wg-skills. Python Redis 模块快速集成技能。面向已拥有 FastAPI 项目骨架的开发者,提供 Redis 缓存、Session 存储、分布式锁、限流、消息队列等能力的快速集成。触发词:"Python Redis"、"FastAPI Redis"、"Redis 集成"、"redis cache"、"redis session"、"redis lock"、"redis 限流"、"redis 消息队列"。
Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).
It sits in Databases, covering Backend development and Caching. It works with Redis, Python and FastAPI. The licence is Apache-2.0.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a4a640b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
REDIS_PASSWORDFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Python Redis Module Skill loads about 1.7k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 61 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
### .envAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jiushiwon/wg-skills at commit a4a640b, republished under its Apache-2.0 licence (© jiushiwon). 61 words, ~1,723 tokens.
.claude/skills/python-redis-module-skill/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.面向已有 FastAPI 项目的开发者,快速集成 Redis 能力。
| 能力 | 说明 |
|---|---|
| 缓存 | 装饰器缓存、缓存更新、缓存删除 |
| Session | Redis Session 共享 |
| 分布式锁 | 基于 Redis 的分布式锁 |
| 限流 | 基于 Redis 的接口限流 |
| 消息队列 | Redis Stream 消息发布/订阅 |
| 计数器 | 分布式计数器 |
用户说"帮我加 Redis"或"集成 Redis"时触发。
pip install redis aioredis# redis_client.py
import redis
from typing import Optional
class RedisClient:
def __init__(self, host: str = "localhost", port: int = 6379, password: Optional[str] = None, db: int = 0):
self.client = redis.Redis(
host=host,
port=port,
password=password,
db=db,
decode_responses=True
)
# 基础操作
def get(self, key: str) -> Optional[str]:
return self.client.get(key)
def set(self, key: str, value: str, ex: Optional[int] = None) -> bool:
return self.client.set(key, value, ex=ex)
def delete(self, *keys: str) -> int:
return self.client.delete(*keys)
def exists(self, key: str) -> bool:
return self.client.exists(key)
def expire(self, key: str, seconds: int) -> bool:
return self.client.expire(key, seconds)
# 哈希操作
def hget(self, name: str, key: str) -> Optional[str]:
return self.client.hget(name, key)
def hset(self, name: str, key: str, value: str) -> int:
return self.client.hset(name, key, value)
def hgetall(self, name: str) -> dict:
return self.client.hgetall(name)
# 列表操作
def lpush(self, name: str, *values: str) -> int:
return self.client.lpush(name, *values)
def rpop(self, name: str) -> Optional[str]:
return self.client.rpop(name)
# 自增
def incr(self, key: str, amount: int = 1) -> int:
return self.client.incr(key, amount)
# 分布式锁
def lock(self, key: str, timeout: int = 30) -> bool:
return self.client.set(f"lock:{key}", "1", nx=True, ex=timeout)
def unlock(self, key: str) -> int:
return self.client.delete(f"lock:{key}")
# 全局实例
redis_client = RedisClient()# cache.py
import json
import functools
from typing import Callable, Optional, Any
def cache(key_prefix: str, expire: int = 300):
"""缓存装饰器"""
def decorator(func: Callable) -> Callable:
@functools.wraps(func)
async def wrapper(*args, **kwargs) -> Any:
# 生成缓存 key
cache_key = f"{key_prefix}:{':'.join(str(a) for a in args)}"
# 尝试从缓存获取
cached = redis_client.get(cache_key)
if cached:
return json.loads(cached)
# 执行函数
result = await func(*args, **kwargs)
# 存入缓存
redis_client.set(cache_key, json.dumps(result, ensure_ascii=False), ex=expire)
return result
return wrapper
return decorator
# 使用示例
@cache("user:info", expire=600)
async def get_user(user_id: int):
# 首次查询数据库,之后从缓存取
return await db.query_user(user_id)# lock.py
import asyncio
from contextlib import asynccontextmanager
from typing import Optional
class RedisLock:
def __init__(self, client: RedisClient):
self.client = client
@asynccontextmanager
async def lock(self, key: str, timeout: int = 30, retry: int = 3, delay: float = 0.2):
"""分布式锁上下文管理器"""
lock_key = f"lock:{key}"
for _ in range(retry):
if self.client.client.set(lock_key, "1", nx=True, ex=timeout):
try:
yield True
finally:
self.client.client.delete(lock_key)
return
await asyncio.sleep(delay)
raise TimeoutError(f"获取锁 {key} 失败")
# 使用
lock = RedisLock(redis_client)
async with lock.lock("order:create"):
# 临界区代码
pass# rate_limit.py
import time
from typing import Optional
class RateLimiter:
def __init__(self, client: RedisClient):
self.client = client
def try_acquire(self, key: str, max_requests: int, window_seconds: int = 60) -> bool:
"""滑动窗口限流"""
now = time.time()
window_key = f"ratelimit:{key}"
# 移除过期的请求记录
self.client.client.zremrangebyscore(window_key, 0, now - window_seconds)
# 当前请求数
current = self.client.client.zcard(window_key)
if current >= max_requests:
return False
# 添加当前请求
self.client.client.zadd(window_key, {str(now): now})
self.client.client.expire(window_key, window_seconds)
return True
# 使用
limiter = RateLimiter(redis_client)
async def check_rate_limit(request_id: str) -> bool:
if not limiter.try_acquire(f"api:{request_id}", 100, 60):
raise Exception("请求过于频繁")
return True# mq.py
import json
from typing import Callable, Dict, Any, Optional
class RedisStream:
def __init__(self, client: RedisClient):
self.client = client
def publish(self, stream: str, data: Dict[str, Any]) -> str:
"""发布消息"""
return self.client.client.xadd(stream, data)
def subscribe(self, stream: str, group: str, consumer: str, count: int = 10, block: int = 5000):
"""订阅消息"""
while True:
messages = self.client.client.xread(
{stream: "0"},
count=count,
block=block
)
if messages:
for stream_name, msgs in messages:
for msg_id, msg_data in msgs:
yield msg_id, msg_data
# 确认消息
self.client.client.xack(stream, group, msg_id)
# 生产者
stream = RedisStream(redis_client)
stream.publish("notifications", {"user_id": "123", "message": "hello"})
# 消费者
async def consume_messages():
async for msg_id, msg in stream.subscribe("notifications", "my-group", "consumer-1"):
print(f"收到消息: {msg}")REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DATABASE=0from pydantic_settings import BaseSettings
class Settings(BaseSettings):
redis_host: str = "localhost"
redis_port: int = 6379
redis_password: str = ""
redis_database: int = 0
settings = Settings()© jiushiwon, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in vibeCoding/backend/python/fastapi-module/python-redis-module-skill of jiushiwon/wg-skills.
Open the folder on GitHubat commit a4a640b
Python Redis Module Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Python Redis Module Skill this skilljiushiwon/wg-skills | 110 | — | ~1.7k | Automated safety check: Notes | Apache-2.0 | |
| FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk | 404 | — | ~2.5k | Automated safety check: Notes | MIT | |
| Flowfile Debugging PlaybookEdwardvaneechoud/Flowfile | 370 | — | ~6.3k | Automated safety check: Pass | MIT | |
| Python PatternsxenitV1/Antigravity-Workflows | 130 | 7 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Azure Cosmos DB Pymicrosoft/skills | 3.1k | — | ~2.8k | Automated safety check: Pass | MIT | |
| Supabase Pythonalinaqi/maggy | 707 | — | ~4k | Automated safety check: Notes | MIT |
redis/fastapi-redis-sdk
Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.
Edwardvaneechoud/Flowfile
Symptom-to-cause triage playbook for Flowfile (core/worker/kernel/frontend/AI) — covers "no such table" DB cascades (two distinct causes), import-time Alembic migration corruption, silent…
xenitV1/Antigravity-Workflows
Python development principles and decision-making. An agent skill from xenitV1/Antigravity-Workflows.
microsoft/skills
Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns.
alinaqi/maggy
FastAPI with Supabase and SQLAlchemy/SQLModel. An agent skill from alinaqi/maggy.
benavlabs/fastcrud
A skill your agent uses when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig…
jiushiwon/wg-skills
A skill your agent uses when generating UI for a specific scenario (mobile/PC/官网/管理端/营销页/文档/金融/原生/3D), when refactoring an existing HTML/Vue/React project to a unified design system, when extracting…
jiushiwon/wg-skills
A skill your agent uses when 用户想用一句话生成流程图、工作流图解、开发流程图、AI 流程图或任何步骤型图解,支持多风格输出(flat icon / 暖白手账风 / dark / cute),并提供现成模板一键出图。
jiushiwon/wg-skills
This skill should be used when the user wants to create a standardized uni-app project for WeChat mini-program, H5, and App from scratch.
jiushiwon/wg-skills
FastAPI 项目一键初始化技能。面向零基础小白,提供环境探测、自动安装、完整 Web 骨架生成、SSE 流式框架、JWT 鉴权、统一响应封装、文件上传接口、一键启动/重启脚本、Swagger 文档,内置 MySQL(默认)/ PostgreSQL / MongoDB 数据库选择。用户只需说"帮我搭一个 FastAPI 项目"即可一条命令完成从零到跑的完整链路。触发词:"FastAPI…
jiushiwon/wg-skills
FFmpeg 多媒体处理技能 — 将自然语言描述转为正确的 ffmpeg 命令,覆盖视频剪辑、转码、水印、合成、提取、生成等操作。内置一键安装脚本(Windows/Mac/Linux)。触发词:ffmpeg、视频剪辑、视频裁剪、视频转码、视频压缩、去水印、加水印、视频拼接、视频合成、提取音频、视频转…
jiushiwon/wg-skills
A skill your agent uses when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error…
Categories
Python Redis 模块快速集成技能。面向已拥有 FastAPI 项目骨架的开发者,提供 Redis 缓存、Session 存储、分布式锁、限流、消息队列等能力的快速集成。触发词:"Python Redis"、"FastAPI Redis"、"Redis 集成"、"redis cache"、"redis session"、"redis lock"、"redis 限流"、"redis…. Python Redis Module Skill is an agent skill from jiushiwon/wg-skills.
Python Redis Module Skill fits situations like: tasks that involve Backend development; tasks that involve Caching.
Run `npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a claude-code`. Or copy the skill folder (vibeCoding/backend/python/fastapi-module/python-redis-module-skill in jiushiwon/wg-skills) into .claude/skills/python-redis-module-skill in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a codex`. Or copy the skill folder (vibeCoding/backend/python/fastapi-module/python-redis-module-skill in jiushiwon/wg-skills) into .agents/skills/python-redis-module-skill in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jiushiwon/wg-skills --skill python-redis-module-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-redis-module-skill, .gemini/skills/python-redis-module-skill, .github/skills/python-redis-module-skill and .opencode/skills/python-redis-module-skill in your project.
Going by SKILL.md and its folder, Python Redis Module Skill needs the command-line tools its instructions call (pip) and credentials named REDIS_PASSWORD. Our summary lists: Python 3; Docker.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Python Redis Module Skill is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Python Redis Module Skill: FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars), Flowfile Debugging Playbook (Edwardvaneechoud/Flowfile, 370 stars), Python Patterns (xenitV1/Antigravity-Workflows, 130 stars) and Azure Cosmos DB Py (microsoft/skills, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jiushiwon (a GitHub user) maintains it in jiushiwon/wg-skills, which has 110 GitHub stars. The repository holds 121 skills in this directory. The repository was last updated on October 4, 2026.
Source: jiushiwon/wg-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.