mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
Support nested imports, closes #351
This commit is contained in:
parent
a3df483c80
commit
7a43af232e
3 changed files with 28 additions and 1 deletions
|
|
@ -1023,6 +1023,12 @@ You can specify Python modules that should be imported and made available to you
|
|||
'"\n".join(textwrap.wrap(value, 100))' \
|
||||
--import=textwrap
|
||||
|
||||
This supports nested imports as well, for example to use `ElementTree <https://docs.python.org/3/library/xml.etree.elementtree.html>`__::
|
||||
|
||||
$ sqlite-utils convert content.db articles content \
|
||||
'xml.etree.ElementTree.fromstring(value).attrib["title"]' \
|
||||
--import=xml.etree.ElementTree
|
||||
|
||||
Use a CODE value of `-` to read from standard input:
|
||||
|
||||
$ cat mycode.py | sqlite-utils convert content.db articles headline -
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue