Skip to content

Documentation - add Docstrings #17

@SinaB0ck

Description

@SinaB0ck

toolbox-functions will be merged with the cophi-toolbox that contains functions from other projects.
For documentation purposes please expand docstrings by author and email.
If necessary enhance the function's description as well.

Conventions:

At the beginning of each module:

"""
Description
"""
author = "" <-- project
authors = "" <-- programmer/s
email = "" <-- <-- programmer/s
license = ""
version = ""
date = "2016-03-20"

For each function:

def functionname (args):
"""
Description

Args:

ToDo:

Author:
"""

For example:

def read_tei5(teiPath, txtFolder, xpath):
"""
Extract selected text from TEI P5 files and write TXT files.

Args:
    teiPath (str): Path / glob pattern of the TEI files to process.
    txtFolder (str): Path to a folder where to write the text files. Will
        be created if it doesn't exist yet.
    xpath (str): From what should the text be extracted?

        ``alltext``
            all text nodes, including header
        ``bodytext``
            text nodes from the body only
        ``seg``
            Only text that is included in ``seg`` elements
        ``said``
            Only text that is included in ``said`` elements

Todo:
    * do we need :func:`lxml.etree.strip_tags` at all? If so, make configurable & sanitize with `xpath`   
      option
    * the :func:`lxml.etree.strip_elements` stuff should be made configurable
    * filename munging should use os.path etc.
    * code cleanup
    * logging instead of print()

Author:
    CLiGS
"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions