Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Python Development Engine

    1

    Python project routing for Web API/crawler/automation/data/CLI. FastAPI/Django/Flask selection, async patterns, deployment strategies.

    Free

    16 usesSecurity scanned

    Python Development Engine

    Example session with this skill installed

    Building a REST API that scrapes 10K product pages daily, processes data, and serves results. Should I use FastAPI or Django? Async or Celery?

    • Read your context and instructions
    • Compiled the python development engine

    Tech Stack Decision: Scraping + API Service

    Project Profile

    • Type: Data pipeline + Web API
    • Scale: 10K pages/day (~7/minute avg, 50/minute peak)
    • Output: REST API serving processed results

    Framework: FastAPI ✅

    FactorFastAPIDjango
    Async supportNativeRequires ASGI + DRF
    Scraping integrationDirect asyncioNeeds Celery bridge
    Performance2-3x faster for I/O-heavyOverhead for ORM
    Setup speed1 day2-3 days

    Concurrency: asyncio + Background Tasks ✅

    • 10K pages/day doesn't need Celery complexity
    • FastAPI BackgroundTasks for scheduled scraping
    • asyncio + aiohttp for concurrent page fetching
    • Only add Celery if you need: retries, monitoring, multi-worker queues

    Architecture

    FastAPI app
    ├── /api/* (endpoints)
    ├── BackgroundTasks (daily scrape scheduler)
    ├── Scraper module (asyncio + aiohttp)
    ├── Processing pipeline (Pandas/Polars)
    └── SQLite → PostgreSQL (when concurrent users > 50)
    

    Don't Over-Engineer

    Start with: FastAPI + asyncio + SQLite. Add Celery/Redis/PostgreSQL only when you hit actual bottlenecks.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Python开发决策引擎

    专家级决策系统——不是教Python语法,而是在框架选型、并发模型、爬虫架构、部署策略这些关键岔路做对选择。


    目录

    1. 项目类型路由器
    2. 框架决策树
    3. 异步方案决策
    4. 爬虫架构决策
    5. 数据工具链
    6. CLI工具开发
    7. 部署决策
    8. 2026年趋势
    9. 质量门控三级清单
    10. 10个常见错误模式
    11. 执行流程

    1. 项目类型路由器

    输入: 项目需求 → 输出: 框架+并发模型+部署方案+数据库选择
    
    决策流程:
      │
      ├─ 是Web API/微服务吗?
      │   ├─ Yes → FastAPI + asyncio + Docker + PostgreSQL
      │   └─ No
      │
      ├─ 需要Admin后台/用户系统/认证吗?
      │   ├─ Yes → Django 5.x + WSGI/ASGI + Docker + MySQL/PostgreSQL
      │   └─ No
      │
      ├─ 是爬虫项目吗?
      │   ├─ 静态页面 + 大规模 → Scrapy + asyncio + Redis队列 + 代理池
      │   ├─ 动态页面/JS渲染 → Playwright + asyncio + IP轮换
      │   └─ 快速原型 → requests + BeautifulSoup
      │
      ├─ 是数据处理/ETL吗?
      │   ├─ <1GB数据 → Polars + Pandas
      │   ├─ 1-10GB数据 → Polars + DuckDB
      │   └─ >10GB数据 → DuckDB + 分区 + 流式处理
      │
      ├─ 是自动化脚本吗?
      │   └─ Typer/Click + subprocess + cron + 日志
      │
      ├─ 是CLI工具吗?
      │   ├─ 分发简单 → Typer + Rich + PyInstaller
      │   └─ 性能敏感 → Typer + Rich + Nuitka编译
      │
      └─ 是AI/ML推理服务吗?
          └─ FastAPI + ONNX Runtime + Docker GPU + 批处理
    

    1.1 Web API完整决策矩阵

    需求维度轻量API中型API企业级API性能敏感型
    推荐框架FastAPIFastAPIFastAPI/DjangoFastAPI + uvicorn
    ORMSQLAlchemySQLAlchemySQLAlchemy/Django ORMasyncpg + SQLAlchemy
    缓存内存CacheRedisRedis + 分布式Redis Cluster
    认证API KeyJWTOAuth2 + SSOJWT + Refresh Token
    文档OpenAPI自动OpenAPI自动OpenAPI + SwaggerOpenAPI + ReDoc
    测试pytest + httpxpytest + coveragepytest + CIpytest + loadtest
    部署Docker单实例Docker + Load BalancerK8s + HPAK8s + HPA + 监控
    数据库SQLite/PostgreSQLPostgreSQLPostgreSQL + 读写分离PostgreSQL + 连接池
    日日夜夜日志结构化日志结构化日志 + ELK结构化日志 + 链路追踪

    1.2 爬虫项目决策矩阵

    维度快速原型中等规模大规模分布式企业级
    爬取量/天<10001000-10万10万-1000万>1000万
    页面类型静态静态+简单JS混合混合+反爬
    技术栈requests+BS4ScrapyScrapy+RedisPlaywright集群
    存储CSV/JSONPostgreSQLPostgreSQL+MongoDB数据湖
    代理需求无少量代理代理池代理池+轮换策略
    失败重试简单重试指数退避队列重试智能重试
    调度单机单机+多线程Redis队列分布式调度
    监控手动日志PrometheusGrafana看板

    1.3 数据处理项目决策矩阵

    数据规模<100MB100MB-1GB1GB-10GB>10GB
    推荐工具PandasPolarsPolars + DuckDBDuckDB
    处理模式全量加载全量/分块分块/流式流式/分区
    并行处理单线程单/多线程多进程多进程+分布式
    内存需求<2GB2-8GB8-32GB可溢出磁盘
    SQL支持无有限良好完整SQL
    生态集成丰富成长中良好良好
    学习曲线低中中中高

    1.4 CLI工具决策矩阵

    场景简单脚本内部工具分发工具企业级CLI
    用户开发者自己团队成员外部用户客户/运维
    框架argparseTyper/ClickTyper + RichTyper + Rich + 测试
    输出美化printRichRichRich + 进度条
    打包直接运行PyInstallerPyInstaller/nuitkapip install / conda
    自动补全无bash/zshfish/zsh全平台
    文档READMEREADME + --helpSphinx/MkDocs完整文档站
    版本管理无简单semverclick-replace
    错误处理sys.exitRich tracebackRich traceback国际化错误

    1.5 技术栈推荐速查表

    # Web API 技术栈推荐
    WEB_API_STACK = {
        "fast": {
            "framework": "FastAPI",
            "orm": "SQLAlchemy[asyncio] + asyncpg",
            "cache": "Redis",
            "auth": "python-jose + passlib",
            "docs": "OpenAPI (auto)",
            "test": "pytest + httpx + pytest-asyncio",
            "deploy": "uvicorn (ASGI)"
        },
        "full": {
            "framework": "Django 5.x + Django REST Framework",
            "orm": "Django ORM",
            "cache": "Redis + django-redis",
            "auth": "django-allauth / JWT",
            "docs": "drf-spectacular (OpenAPI)",
            "test": "pytest-django",
            "deploy": "gunicorn (WSGI)"
        },
        "light": {
            "framework": "Flask",
            "orm": "SQLAlchemy",
            "cache": "Flask-Caching",
            "auth": "Flask-JWT-Extended",
            "docs": "flask-restx",
            "test": "pytest + Flask-Testing",
            "deploy": "gunicorn"
        }
    }
    
    # 爬虫技术栈推荐
    CRAWLER_STACK = {
        "simple": {
            "framework": "requests + BeautifulSoup",
            "parser": "lxml",
            "storage": "CSV/JSON",
            "concurrent": "concurrent.futures"
        },
        "medium": {
            "framework": "Scrapy",
            "parser": "parsel (内置)",
            "storage": "PostgreSQL/MongoDB",
            "concurrent": "asyncio + scrapy-asyncio"
        },
        "complex": {
            "framework": "Playwright + Scrapy",
            "parser": "parsel + JS执行",
            "storage": "PostgreSQL + S3",
            "concurrent": "asyncio + 进程池",
            "proxy": "代理池 + 轮换",
            "anti_detection": "stealth插件"
        }
    }
    
    # 数据处理技术栈推荐
    DATA_STACK = {
        "small": {
            "main": "pandas",
         
    

    • Focuses on architecture and selection rather than writing specific business logic.
    • Best suited for modern (2024+) Python environments.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    16 uses

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Requires

    Proxy1
    Proxy2
    Proxy
    Astral

    Permissions

    Read Files
    Write Files
    Browser
    Network Access
    Environment Variables

    Allowed Hosts

    api.example.com
    proxy1.com
    proxy2.com
    example.com
    proxy.com
    astral.sh
    Listed4 months ago
    Updated15 days ago

    What's inside

    Frequently Asked Questions

    It provides a decision matrix to choose between Scrapy for scale, Playwright for JS rendering, or Requests for speed.

    The engine uses a data scale threshold: Polars for 1GB to 10GB, and DuckDB for anything over 10GB or SQL heavy.

    Yes, it includes specific scaffolding for FastAPI, Django 5.x, and Flask based on project complexity.

    It offers a 3 level quality gate and a list of 10 common Python anti patterns to avoid during development.