# General Translation Changelog: gt-cli 2.8.0: Python project support
URL: https://generaltranslation.com/en-US/blog/gt-cli_v2_8_0.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 
Authors: Ernest McCarter
Published: 2026-03-10

## Overview

The `gt` CLI now supports Python projects. Running [`gt upload`](/docs/cli/reference/commands/upload) in a Flask or FastAPI project extracts [`t()`](/docs/python/reference/functions/t) calls from your Python source files and registers them with the GT platform.

## What changed

A new `@generaltranslation/python-extractor` package parses Python source files and extracts translation calls. The CLI auto-detects Python projects by checking for `gt-flask` or `gt-fastapi` in your `pyproject.toml`, `requirements.txt`, or `setup.py`.

The extractor handles:

- `t("string literal")` calls with keyword variable interpolation
- [`declare_var()`](/docs/python/reference/functions/declare-var) for marking dynamic f-string expressions as variables
- [`declare_static()`](/docs/python/reference/functions/declare-static) for embedding static expressions that should be evaluated at extraction time
- Python-specific metadata kwargs (`_context`, `_id`, `_max_chars`) -- underscore-prefixed keyword arguments rather than the options object used in the JavaScript libraries

## Example

```python
from gt_flask import t

@app.get("/error")
def error():
    return {"error": t("Something went wrong. Please try again.", _context="error page")}
```

[`gt upload`](/docs/cli/reference/commands/upload) extracts the string and registers it with the platform. [`gt translate`](/docs/cli/reference/commands/translate) generates translations for your configured locales. Same commands, same workflow as the JavaScript libraries.

## Links

- [gt-flask and gt-fastapi dev log](/devlog/gt-flask_v0_1_0)
- [CLI documentation](/docs/cli/reference/config)
- [Source (CLI)](https://github.com/generaltranslation/gt)
- [Source (Python)](https://github.com/generaltranslation/gt-python)

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
