Import-Module Samples

Template File

.. -*- mode: rst -*-

Static Heading
--------------

List of Directory Entries
~~~~~~~~~~~~~~~~~~~~~~~~~~

{% for item in data.scandir() | sort(attribute='name') %}
- {{item.name}}'s size is {{item.stat().st_size}} Bytes
{% endfor %}

File Path of the Null Device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``{{data.devnull}}``

Loading the Template

.. datatemplate:import-module:: os
   :template: import-module-sample.tmpl

Rendered Output

Static Heading

List of Directory Entries

  • .github’s size is 60 Bytes

  • .gitignore’s size is 201 Bytes

  • .mergify.yml’s size is 1002 Bytes

  • .pc’s size is 140 Bytes

  • .pybuild’s size is 60 Bytes

  • .readthedocs.yaml’s size is 176 Bytes

  • build’s size is 80 Bytes

  • debian’s size is 340 Bytes

  • doc’s size is 80 Bytes

  • html’s size is 60 Bytes

  • LICENSE’s size is 1495 Bytes

  • pyproject.toml’s size is 1640 Bytes

  • pytest.ini’s size is 51 Bytes

  • README.rst’s size is 1756 Bytes

  • sphinxcontrib’s size is 60 Bytes

  • sphinxcontrib.datatemplates.egg-info’s size is 160 Bytes

  • tests’s size is 160 Bytes

  • tox.ini’s size is 543 Bytes

File Path of the Null Device

/dev/null