# is_env_truthy

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_env_vars/is_env_truthy)

Return whether env var *name* is set to a recognizably truthy value.

Unlike `bool(os.environ.get(name))`, this does not treat `"0"` or
`"false"` as enabled. Use this for on/off flags where the user would
reasonably expect `VAR=0` to mean "disabled".

## Signature

```python
is_env_truthy(
    name: str,
    *,
    default: bool = False,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | `str` | Yes | Environment variable name (typically a `DEEPAGENTS_CODE_*` constant from this module). |
| `default` | `bool` | No | Value returned when the variable is unset OR set to a value that is neither recognizably truthy nor falsy. (default: `False`) |

## Returns

`bool`

`True` for `1`/`true`/`yes`/`on` (case-insensitive), `False` for

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a98f0dfa8d534d8a1885b524632400e52db22ac6/libs/code/deepagents_code/_env_vars.py#L201)