> ## Documentation Index
> Fetch the complete documentation index at: https://anki.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Command-Line Use

The `anki` module can be used separately from Anki's GUI. It is
strongly recommended you use it instead of attempting to read or
write a .anki2 file directly.

Install it with pip:

```shell theme={null}
$ pip install anki
```

Then you can use it in a .py file, like so:

```python theme={null}
from anki.collection import Collection
col = Collection("/path/to/collection.anki2")
print(col.sched.deck_due_tree())
```

See [the Anki module](./the-anki-module) for more.
