<commit_before>Backend
=======

.. _analyses_configurations:

Analyses Configurations
-----------------------

Example ``analyses/index.yaml``:

.. literalinclude:: ../databench/analyses_packaged/index.yaml
    :language: yaml

Defaults at the global level for ``index.yaml``:

.. code-block:: none

    title: Databench
    description: null
    description_html: null
    author: null
    version: null
    build: null
    watch: null

    analyses:
      ...

Examples for customization:

.. code-block:: none

    title: Databench - Packaged Analyses
    description: my awesome analyses


Templates
---------

Modify the `base.html`_, `analysis.html`_ or any other html template file
in your analyses path. Use ``analyses/static`` for static assets like logos and favicons which is exposed at ``/static``.

.. _`base.html`: <https://github.com/svenkreiss/databench/blob/master/databench/templates/base.html>_
.. _`analysis.html`: <https://github.com/svenkreiss/databench/blob/master/databench/templates/analysis.html>_


Routes
------

Add a ``routes.py`` file to your analysis with extra Tornado request handlers
and register them in a ``ROUTES`` variable. This is an example of a
``routes.py`` file:

.. literalinclude:: ../tests/analyses/simple2/routes.py
    :language: python


Autoreload
----------

Uses http://www.tornadoweb.org/en/stable/autoreload.html in the backend which
is only activated Databench is run with ``--log INFO`` or ``--log DEBUG``.
<commit_msg>template doc update<commit_after>Backend
=======

.. _analyses_configurations:

Analyses Configurations
-----------------------

Example ``analyses/index.yaml``:

.. literalinclude:: ../databench/analyses_packaged/index.yaml
    :language: yaml

Defaults at the global level for ``index.yaml``:

.. code-block:: none

    title: Databench
    description: null
    description_html: null
    author: null
    version: null
    build: null
    watch: null

    analyses:
      ...

Examples for customization:

.. code-block:: none

    title: Databench - Packaged Analyses
    description: my awesome analyses


Templates
---------

Modify the `base.html`_, `analysis.html`_ or any other html template file
in your analyses path. Use ``analyses/static`` for static assets like logos and favicons which is exposed at ``/static``.

.. _`base.html`: <https://github.com/svenkreiss/databench/blob/master/databench/templates/base.html>_
.. _`analysis.html`: <https://github.com/svenkreiss/databench/blob/master/databench/templates/analysis.html>_

Default ``analyses/base.html``:

.. literalinclude:: ../databench/templates/base.html
    :language: html

Default ``analyses/analysis.html``:

.. literalinclude:: ../databench/templates/analysis.html
    :language: html


Routes
------

Add a ``routes.py`` file to your analysis with extra Tornado request handlers
and register them in a ``ROUTES`` variable. This is an example of a
``routes.py`` file:

.. literalinclude:: ../tests/analyses/simple2/routes.py
    :language: python


Autoreload
----------

Uses http://www.tornadoweb.org/en/stable/autoreload.html in the backend which
is only activated Databench is run with ``--log INFO`` or ``--log DEBUG``.

{'fraction_non_alphanumeric': 0.1509433962264151, 'fraction_numerical': 0.0006289308176100629, 'mean_word_length': 3.2356857523302263, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1598548', 'n_tokens_mistral': 1011, 'n_tokens_neox': 940, 'n_words': 276}