Toolverse
All skills

superpowers-python-automation

by anthonylee991

Implements reliable automations in Python for REST APIs: httpx/requests patterns, retries, timeouts, pagination, typing, config, logging, and tests. Use when writing Python scripts/services that call external APIs.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Backend
Views
5

About this skill

Implements reliable automations in Python for REST APIs: httpx/requests patterns, retries, timeouts, pagination, typing, config, logging, and tests. Use when writing Python scripts/services that call external APIs.

How to use

  1. Zainstaluj skill w swoim projekcie Pythona i upewnij się, że masz dostęp do bibliotek httpx (lub requests) oraz pytest. Jeśli projekt jeszcze ich nie używa, dodaj je do requirements.txt.

  2. Utwórz strukturę katalogów zgodnie z architekturą: client.py dla wrappera API (auth, retry'e, paginacja), models.py dla typowanych modeli danych (dataclasses lub pydantic), sync.py dla logiki orkestracji (pobierz → transformuj → zaktualizuj), main.py jako punkt wejścia CLI, oraz katalog tests/ na testy jednostkowe.

  3. W client.py zaimplementuj centralizowaną funkcję do wysyłania żądań HTTP. Zawsze ustaw timeouty (connect i read osobno), nigdy nie loguj sekretów takich jak Authorization headers czy tokeny, a obsługuj retry'e dla błędów sieciowych, timeout'ów, 429 (Retry-After), oraz 500–599. Nie retry'uj błędów 400–499 chyba że operacja jest bezpieczna.

  4. Obsługi paginację poprzez helper, który wspiera co najmniej jeden z wzorców: next URL w odpowiedzi, cursor token lub parametry page/limit. Dodaj hard stop – maksymalną liczbę stron lub rekordów, aby uniknąć nieskończonych pętli.

  5. Napisz testy dla logiki transformacji i zachowania klienta API. Użyj pytest oraz respx do mockowania żądań httpx, aby upewnić się, że retry'e i timeouty działają poprawnie bez rzeczywistych połączeń sieciowych.

  6. Jeśli projekt już używa innych narzędzi (inny HTTP client, inny logger, inne konwencje), postępuj zgodnie z istniejącymi standardami zamiast domyślnych wzorców – spójność z kodem istniejącym ważniejsza niż dogmatyczne stosowanie się do skill'u.

Related skills

literature-review

by K-Dense-AI

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature

Backend
238507

youtube-transcribe-skill

by feiskyer

Extract subtitles/transcripts from a YouTube video URL and save as a local file. Use when you need to extract subtitles from a YouTube video.

Backend
24178

patent-search

by RobThePCGuy

Advanced prior art search using the PatentsView API. Use this skill when users need to search for patents, perform prior art searches, analyze patent landscapes, or find patents by inventor, title, date range, or technical fields. Helps with patent research, freedom to operate

Backend
36218

postgresql-psql

by timelessco

Comprehensive guide for PostgreSQL psql - the interactive terminal client for PostgreSQL. Use when connecting to PostgreSQL databases, executing queries, managing databases/tables, configuring connection options, formatting output, writing scripts, managing transactions, and

Backend
34173

sql-optimization-patterns

by wshobson

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

Backend
40163

using-superpowers

by obra

Use when starting any conversation - establishes mandatory workflows for finding and using skills, including using Skill tool before announcing usage, following brainstorming before coding, and creating TodoWrite todos for checklists

Backend
65167