From 0b7b80bd40fe86e4d66a04c9f607d94991c45c0b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 25 Mar 2022 13:07:29 -0700 Subject: [PATCH] Document the convert() with initialization pattern, closes #420 --- docs/cli.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/cli.rst b/docs/cli.rst index 8bd3650..5a03402 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -1002,6 +1002,8 @@ The ``--convert`` option also works with the ``--csv``, ``--tsv`` and ``--nl`` i As with ``sqlite-utils convert`` you can use ``--import`` to import additional Python modules, see :ref:`cli_convert_import` for details. +You can also pass code that runs some initialization steps and defines a ``convert(value)`` function, see :ref:`cli_convert_complex`. + .. _cli_insert_convert_lines: \-\-convert with \-\-lines @@ -1285,6 +1287,27 @@ This supports nested imports as well, for example to use `ElementTree