# libtmux.neo.fetch_objs

- **Module:** libtmux.neo
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/neo.py#L661
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-neo-fetch_objs/

```
libtmux.neo.fetch_objs(
    server: Server,
    list_cmd: ListCmd,
    list_extra_args: ListExtraArgs = None,
    filter: str | None = None,
    # noqa: A002,
) -> OutputsRaw
```

Fetch a listing of raw data from a tmux command.

Runs a tmux list command (e.g. [`list-sessions`](/en/tmux/latest/manual/list-sessions/)) with the format string
from :func:`get_output_format` and parses each line of output into a dict.

## Examples

```python
>>> from libtmux.neo import fetch_objs
>>> objs = fetch_objs(server=server, list_cmd="list-sessions")
>>> isinstance(objs, list)
True
>>> isinstance(objs[0], dict)
True
>>> 'session_id' in objs[0]
True
```

## Parameters

- `server` (`Server`): The tmux server to query.
- `list_cmd` (`ListCmd`): The tmux list command to run, e.g. ``"list-sessions"``,
``"list-windows"``, or ``"list-panes"``.
- `list_extra_args` (`ListExtraArgs`): Extra arguments appended to the tmux command (e.g. ``("-a",)``
for all windows/panes, or ``["-t", session_id]`` to filter).
- `filter` (`str | None`): Filter expression evaluated by tmux (``-f`` flag). tmux omits rows
whose expanded expression is false before libtmux parses the result.
tmux silently expands a malformed filter (unclosed ``#{...}``,
unknown format token) to empty, which is treated as false —
every row is suppressed and no stderr is emitted. A bad filter
is indistinguishable from "filter matched nothing"; verify the
expression against the FORMATS section of ``tmux(1)``. See
:ref:`native-filtering` for the typed wrappers that share this
caveat. Warning: (added 0.57)
- `# noqa: A002`

## Returns

OutputsRaw
    A list of dicts, each mapping tmux format field names to their
    non-empty string values.

## Raises

- [`LibTmuxException`](/en/py/stable/reference/libtmux-exc-libtmuxexception/): If the tmux command writes to stderr.
