cwltool.builder
===============

.. py:module:: cwltool.builder

.. autoapi-nested-parse::

   Command line builder.



Attributes
----------

.. autoapisummary::

   cwltool.builder.INPUT_OBJ_VOCAB


Classes
-------

.. autoapisummary::

   cwltool.builder.Builder


Functions
---------

.. autoapisummary::

   cwltool.builder.content_limit_respected_read_bytes
   cwltool.builder.content_limit_respected_read
   cwltool.builder.substitute


Module Contents
---------------

.. py:data:: INPUT_OBJ_VOCAB
   :type:  dict[str, str]

.. py:function:: content_limit_respected_read_bytes(f)

   Read a file as bytes, respecting the :py:data:`~cwltool.utils.CONTENT_LIMIT`.

   :param f: file handle
   :returns: the file contents
   :raises WorkflowException: if the file is too large


.. py:function:: content_limit_respected_read(f)

   Read a file as a string, respecting the :py:data:`~cwltool.utils.CONTENT_LIMIT`.

   :param f: file handle
   :returns: the file contents
   :raises WorkflowException: if the file is too large


.. py:function:: substitute(value, replace)

   Perform CWL SecondaryFilesDSL style substitution.


.. py:class:: Builder(job, files, bindings, schemaDefs, names, requirements, hints, resources, mutation_manager, formatgraph, make_fs_access, fs_access, job_script_provider, timeout, debug, js_console, force_docker_pull, loadListing, outdir, tmpdir, stagedir, cwlVersion, container_engine)

   Bases: :py:obj:`cwltool.utils.HasReqsHints`

   .. autoapi-inheritance-diagram:: cwltool.builder.Builder
      :parts: 1


   Helper class to construct a command line from a CWL CommandLineTool.


   .. py:attribute:: job


   .. py:attribute:: files


   .. py:attribute:: bindings


   .. py:attribute:: schemaDefs


   .. py:attribute:: names


   .. py:attribute:: requirements


   .. py:attribute:: hints


   .. py:attribute:: resources


   .. py:attribute:: mutation_manager


   .. py:attribute:: formatgraph


   .. py:attribute:: make_fs_access


   .. py:attribute:: fs_access


   .. py:attribute:: job_script_provider


   .. py:attribute:: timeout


   .. py:attribute:: debug


   .. py:attribute:: js_console


   .. py:attribute:: force_docker_pull


   .. py:attribute:: loadListing


   .. py:attribute:: outdir


   .. py:attribute:: tmpdir


   .. py:attribute:: stagedir


   .. py:attribute:: cwlVersion


   .. py:attribute:: pathmapper
      :type:  Optional[cwltool.pathmapper.PathMapper]
      :value: None



   .. py:attribute:: find_default_container
      :type:  collections.abc.Callable[[], str] | None
      :value: None



   .. py:attribute:: container_engine


   .. py:method:: build_job_script(commands)

      Use the job_script_provider to turn the commands into a job script.



   .. py:method:: bind_input(schema, datum, discover_secondaryFiles, lead_pos = None, tail_pos = None)

      Bind an input object to the command line.

      :raises ValidationException: in the event of an invalid type union
      :raises WorkflowException: if a CWL Expression ("position", "required",
        "pattern", "format") evaluates to the wrong type or if a required
        secondary file is missing



   .. py:method:: tostr(value)

      Represent an input parameter as a string.

      :raises WorkflowException: if the item is a File or Directory and the
        "path" is missing.



   .. py:method:: generate_arg(binding)

      Convert an input binding to a list of command line arguments.



   .. py:method:: do_eval(ex, context = None, recursive = False, strip_whitespace = True)


