# Python Libraries

> Reach for this project's preferred, well-supported libraries instead of hand-rolling. Use when choosing a library for HTTP, retries, JSON, or parsing, or whenever you are about to write something the standard library or a maintained package already does.

- **Type:** Skill
- **Install:** `agentstack add skill-owenlamont-agent-skills-python-libraries`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [owenlamont](https://agentstack.voostack.com/s/owenlamont)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [owenlamont](https://github.com/owenlamont)
- **Source:** https://github.com/owenlamont/agent_skills/tree/main/skills/python-libraries

## Install

```sh
agentstack add skill-owenlamont-agent-skills-python-libraries
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Python Libraries

Prefer well-supported libraries (and the standard library) over hand-rolled code — it is
less to maintain and less to get wrong than reinventing a solved problem.

## Don't reinvent the wheel

- Don't hand-roll retry or backoff loops — use `stamina` (it wraps `tenacity` with sane
  defaults: capped attempts, jitter, and retrying only the exceptions you name). Set a
  timeout and exclude non-retryable errors, such as a 4xx that won't change on retry.
- Don't reimplement what `itertools` (stdlib) or `more-itertools` already provide
  (grouping, chaining, windowing, accumulating) — reach for them instead. See
  `python-code-style` for the broader "prefer stdlib idioms" rule.
- Don't parse HTML or XML with regex — use `parsel` (XPath and CSS selectors).

## HTTP

- Use an HTTP client with async support — this rules out `requests` and `urllib`.
- Match the async client the repo already uses rather than introducing a second one, and
  don't add another HTTP client as a (dev) dependency without a concrete reason.
- Set an explicit timeout on outbound requests; a single client-level default is fine,
  but never rely on the library default, which is often `None` (waits forever).

## JSON

- Use `orjson` over the standard library `json` for serialising and deserialising — it is
  faster and better-behaved.
- When a Pydantic model is involved, go straight to and from JSON bytes with
  `Model.model_validate_json(raw)` and `model.model_dump_json()` — one fast
  parse-and-validate pass.
- Don't call an HTTP response's `.json()` and hand the resulting dict to Pydantic: that
  parses twice (the client builds a dict, then Pydantic re-validates it). Pass the raw
  bytes (`response.content`) to `Model.model_validate_json(...)` instead.

See `python-async` for deploying on `uvloop`, and `python-datetime` for dates and times.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [owenlamont](https://github.com/owenlamont)
- **Source:** [owenlamont/agent_skills](https://github.com/owenlamont/agent_skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-owenlamont-agent-skills-python-libraries
- Seller: https://agentstack.voostack.com/s/owenlamont
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
