---
title: "Use Python for data work and as a second · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/languages-and-runtimes/python
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Use Python for data work and as a second server language

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/stack/rules.json) holds every rule of this playbook as JSON.

- Level: Recommended
- Chapter: [Languages and runtimes](https://agentwranglers.se/playbook/stack/languages-and-runtimes)
- Rule: Use a Python version in its bugfix phase for scripts, data jobs and APIs, and keep each project on one version.
- Cost: Open source. PSF licence, free to use and ship in any project.
- How: Python passes all five tests. Python 3.0 shipped in December 2008. Python 3.15 shipped on 9 October 2026, and 3.14 gets fixes until October 2027 and security fixes until October 2030. In the Stack Overflow Developer Survey 2026, 58.0% of developers used it. It uses the PSF licence, which the OSI approves. Start new projects on 3.14 and move to 3.15 in April 2027, once agents know it. Choose something else when the app has a large browser front end, where TypeScript lets one language cover both ends. Check its types, as [Use Pyright to check Python types](https://agentwranglers.se/playbook/stack/testing-and-code-quality/pyright) says.
- Check: `python3 --version` prints 3.14 or 3.15. `requires-python` in `pyproject.toml` names the same version. No server runs 3.10 or older.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### TOML example

```toml
[project]
name = "bookings-api"
version = "1.0.0"
requires-python = ">=3.14,<3.15"
```

### Python example

```python
from dataclasses import dataclass
from datetime import datetime

@dataclass(frozen=True)
class Booking:
    id: str
    starts_at: datetime
    seats: int

def total_seats(bookings: list[Booking]) -> int:
    return sum(booking.seats for booking in bookings)
```

## Sources

- [Status of Python versions](https://devguide.python.org/versions/)
- [Python downloads](https://www.python.org/downloads/)

## Related rules

- [Use Pyright to check Python types](https://agentwranglers.se/playbook/stack/testing-and-code-quality/pyright) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/languages-and-runtimes/python">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use Node.js on an LTS line](https://agentwranglers.se/playbook/stack/languages-and-runtimes/nodejs-lts)
- Next: [Use npm with a lock file for JavaScript packages](https://agentwranglers.se/playbook/stack/languages-and-runtimes/npm)
- [Languages and runtimes](https://agentwranglers.se/playbook/stack/languages-and-runtimes)
