summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Kislyuk <andrey.kislyuk@color.com>2024-04-17 16:11:45 -0700
committerAndrey Kislyuk <andrey.kislyuk@color.com>2024-04-17 16:14:46 -0700
commit659d2a2aca2a5ce9804a4eca501e9babb9ab3453 (patch)
tree0925aa6b7115e7515f6e028ac67c21e267f326e0
parent88d742b8df936e89f9b42707a341c11037a61755 (diff)
Add module entry points for xq and tomlq
-rw-r--r--README.rst5
-rw-r--r--yq/tomlq/__init__.py0
-rw-r--r--yq/tomlq/__main__.py4
-rw-r--r--yq/xq/__init__.py0
-rw-r--r--yq/xq/__main__.py4
5 files changed, 11 insertions, 2 deletions
diff --git a/README.rst b/README.rst
index 6fd5508..6fcdfb9 100644
--- a/README.rst
+++ b/README.rst
@@ -114,13 +114,14 @@ the ``xq --xml-output``/``xq -x`` option. Multiple XML documents can be passed i
``xq a.xml b.xml``. Use ``--xml-item-depth`` to descend into large documents, streaming their contents without loading
the full doc into memory (for example, stream a `Wikipedia database dump <https://dumps.wikimedia.org>`_ with
``cat enwiki-*.xml.bz2 | bunzip2 | xq . --xml-item-depth=2``). Entity expansion and DTD resolution is disabled to avoid
-XML parsing vulnerabilities.
+XML parsing vulnerabilities. Use ``python -m yq.xq`` if you want to ensure a specific Python runtime.
TOML support
------------
``yq`` supports `TOML <https://toml.io/>`_ as well. The ``yq`` package installs an executable, ``tomlq``, which uses the
`tomlkit library <https://github.com/sdispater/tomlkit>`_ to transcode TOML to JSON, then pipes it to ``jq``. Roundtrip
-transcoding is available with the ``tomlq --toml-output``/``tomlq -t`` option.
+transcoding is available with the ``tomlq --toml-output``/``tomlq -t`` option. Use ``python -m yq.tomlq`` if you want to
+ensure a specific Python runtime.
.. admonition:: Compatibility note
diff --git a/yq/tomlq/__init__.py b/yq/tomlq/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/yq/tomlq/__init__.py
diff --git a/yq/tomlq/__main__.py b/yq/tomlq/__main__.py
new file mode 100644
index 0000000..2296350
--- /dev/null
+++ b/yq/tomlq/__main__.py
@@ -0,0 +1,4 @@
+from .. import tq_cli
+
+if __name__ == "__main__":
+ tq_cli()
diff --git a/yq/xq/__init__.py b/yq/xq/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/yq/xq/__init__.py
diff --git a/yq/xq/__main__.py b/yq/xq/__main__.py
new file mode 100644
index 0000000..e2b6d34
--- /dev/null
+++ b/yq/xq/__main__.py
@@ -0,0 +1,4 @@
+from .. import xq_cli
+
+if __name__ == "__main__":
+ xq_cli()