# General Translation Python SDKs: derive
URL: https://generaltranslation.com/en-US/docs/python/reference/functions/derive.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Mark content with a finite set of variants for build-time extraction in General Translation Python. API reference for derive.

Marks content as statically analyzable so the General Translation CLI can extract every possible translation entry at build time. It is an identity function — it returns exactly what you pass in — used purely as a marker.

## Overview [#overview]

Wrap a static expression that has a finite set of possible values with `derive`, typically inside a [`t`](/docs/python/reference/functions/t) call. At runtime `derive` returns its input unchanged; at extraction time the CLI generates a translation entry for each outcome.

```python
from gt_flask import derive, t  # or: from gt_fastapi, or: from gt_i18n

message = t(f"The {derive('boy' if gender == 'male' else 'girl')} is playing.")
```

Signature:

```python
derive(content: object) -> object
```

Re-exported from `generaltranslation.static` by `gt_i18n` and the framework packages. See [Declaring variables and variants](/docs/python/guides/declaring-variables) for usage patterns.

## How it works [#how-it-works]

- **Identity at runtime.** It returns `content` unchanged; its only purpose is to mark content for the CLI.
- **Static analysis.** All possible outcomes must be statically analyzable at build time so the CLI can generate an entry for each.
- **Dynamic values.** Wrap dynamic content inside a derived sentence with [`declare_var`](/docs/python/reference/functions/declare-var).

## Parameters [#parameters]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| [`content`](#content) | A static expression with a finite set of possible values. | `object` | No | — |

### `content` [#content]

**Type** `object` · **Required**

A static expression with a finite set of possible values.

## Returns [#returns]

**Type** `object`

Returns `content` unchanged. The function is an identity marker for the CLI.

## Example [#example]

```python
from gt_flask import t, derive, declare_var

t(f"{declare_var(name, name='name')} adopted a {derive('cat' if is_cat else 'dog')}.")
```

*Note: [`declare_static`](/docs/python/reference/functions/declare-static) is a deprecated alias for `derive`. Use `derive` in new code.*

## Sitemap

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