# dotenv

<PyAttributes>

<PyAttribute name="__all__" value="['get_cli_string', 'load_dotenv', 'dotenv_values', 'get_key', 'set_key', 'unset_key', 'find_dotenv', 'load_ipython_extension']">
</PyAttribute>

</PyAttributes>

<Tabs items="[&quot;Functions&quot;,&quot;Modules&quot;]">

<Tab value="Functions">

<PyFunction name="load_ipython_extension" type="(ipython) -> None">

<PySourceCode>

```python
def load_ipython_extension(ipython: Any) -> None:
    from .ipython import load_ipython_extension

    load_ipython_extension(ipython)
```

</PySourceCode>

<div>

<PyParameter name="ipython" type="Any">
</PyParameter>

</div>

<PyFunctionReturn type="None">
</PyFunctionReturn>

</PyFunction>

<PyFunction name="get_cli_string" type="(path=None, action=None, key=None, value=None, quote=None)">

Returns a string suitable for running as a shell script.

Useful for converting a arguments passed to a fabric task
to be passed to a `local` or `run` command.

<PySourceCode>

```python
def get_cli_string(
    path: Optional[str] = None,
    action: Optional[str] = None,
    key: Optional[str] = None,
    value: Optional[str] = None,
    quote: Optional[str] = None,
):
    """Returns a string suitable for running as a shell script.

    Useful for converting a arguments passed to a fabric task
    to be passed to a `local` or `run` command.
    """
    command = ["dotenv"]
    if quote:
        command.append(f"-q {quote}")
    if path:
        command.append(f"-f {path}")
    if action:
        command.append(action)
        if key:
            command.append(key)
            if value:
                if " " in value:
                    command.append(f'"{value}"')
                else:
                    command.append(value)

    return " ".join(command).strip()
```

</PySourceCode>

<div>

<PyParameter name="path" type="Optional[str]" value="None">
</PyParameter>

<PyParameter name="action" type="Optional[str]" value="None">
</PyParameter>

<PyParameter name="key" type="Optional[str]" value="None">
</PyParameter>

<PyParameter name="value" type="Optional[str]" value="None">
</PyParameter>

<PyParameter name="quote" type="Optional[str]" value="None">
</PyParameter>

</div>

<PyFunctionReturn>
</PyFunctionReturn>

</PyFunction>

</Tab>

<Tab value="Modules">

<Cards>

<Card title="version" href="./version.md">
</Card>

<Card title="variables" href="./variables/index.md">
</Card>

<Card title="parser" href="./parser/index.md">
</Card>

<Card title="cli" href="./cli.md">
</Card>

<Card title="ipython" href="./ipython/index.md">
</Card>

<Card title="main" href="./main/index.md">
</Card>

<Card title="__main__" href="./-__main__.md">
</Card>

</Cards>

</Tab>

</Tabs>
