diff --git a/docs/basics/101-130-yodaproject.rst b/docs/basics/101-130-yodaproject.rst index 3c7fd1c99..b56ea7ddf 100644 --- a/docs/basics/101-130-yodaproject.rst +++ b/docs/basics/101-130-yodaproject.rst @@ -107,6 +107,28 @@ a Python API for DataLad's functionality that you can read about in :ref:`a Find As the Python API does not suffer from the startup time cost of the command line, there is the potential for substantial speed-up when doing many calls to the API, and using a persistent Dataset object instance. + You will also notice that the output of Python commands can be more verbose as the result records returned by each command do not get filtered by command-specific result renderers. + Thus, the outcome of ``dl.status('myfile')`` matches that of :dlcmd:`status` only when ``-f``/``--output-format`` is set to ``json`` or ``json_pp``, as illustrated below. + + .. code-block:: python + + >>> import datalad.api as dl + >>> dl.status('myfile') + [{'type': 'file', + 'gitshasum': '915983d6576b56792b4647bf0d9fa04d83ce948d', + 'bytesize': 85, + 'prev_gitshasum': '915983d6576b56792b4647bf0d9fa04d83ce948d', + 'state': 'clean', + 'path': '/home/me/my-ds/myfile', + 'parentds': '/home/me/my-ds', + 'status': 'ok', + 'refds': '/home/me/my-ds', + 'action': 'status'}] + + .. code-block:: bash + + $ datalad -f json status myfile + {"action": "status", "bytesize": 85, "gitshasum": "915983d6576b56792b4647bf0d9fa04d83ce948d", "parentds": "/home/me/my-ds", "path": "/home/me/my-ds/myfile", "prev_gitshasum": "915983d6576b56792b4647bf0d9fa04d83ce948d", "refds": "/home/me/my-ds/", "state": "clean", "status": "ok", "type": "file"} .. importantnote:: Use DataLad in languages other than Python