authors package

authors.lib module

This module contains functions used by authors.

authors.lib.read_configuration_file(file='.authors.yml')[source]

Reads a configuration file, usually .authors.yml.

Parameters:file (str) –

The name of a file with user-defined configuration settings.

The default value is .authors.yml.

Returns:The contents of a configuration file or an empty str.
Return type:str
authors.lib.parse_yaml_to_dict(contents)[source]

Parses YAML to a dict.

Parameters:contents (str) – The contents of a file with user-defined configuration settings.
Returns:Configuration settings (one key-value pair per setting) or an empty dict.
Return type:dict
authors.lib.validate_configuration(configuration)[source]

Validates configuration settings.

Parameters:configuration (dict) – The unvalidated configuration settings.
Returns:configuration – The validated configuration settings, using default values in the case of missing or invalid values.
Return type:dict
authors.lib.read_standard_input()[source]

Reads from standard input.

Returns:authors – A unique, sorted list of authors.
Return type:list
authors.lib.render_template(authors, configuration)[source]

Renders a template in adoc, html, md, rst, or txt format.

Parameters:
  • authors (list) – The authors to include in the rendered template.
  • configuration (dict) – Configuration settings relevant to the rendered template (heading, opening, and closing).
Returns:

The rendered template.

Return type:

str

authors.lib.write_authors_file(contents, configuration)[source]

Writes the rendered template to a file, usually AUTHORS.

Parameters:
  • contents (str) – The rendered template.
  • configuration (dict) – Configuration settings relevant to the AUTHORS file (name).
authors.lib.main(file='.authors.yml')[source]

Generates an AUTHORS file.

Parameters:file (str) –

The name of a file with user-defined configuration settings.

The default value is .authors.yml.

Module contents

Thank the people who contribute to your Git/GitHub project by creating an AUTHORS file.

authors.main(file='.authors.yml')[source]

Generates an AUTHORS file.

Parameters:file (str) –

The name of a file with user-defined configuration settings.

The default value is .authors.yml.