inspirehep.modules.tools package

Submodules

inspirehep.modules.tools.authorlist module

Functions to parse an authorlist.

inspirehep.modules.tools.authorlist.create_authors(text)[source]

Split text in (useful) blocks, sepatated by empty lines. 1 block: no affiliations 2 blocks: authors and affiliations more blocks: authors grouped by affiliation (not implemented yet)

Returns:with two keys: authors of the form (author_fullname, [author_affiliations]) and warnings which is a list of strings.
Return type:dict
inspirehep.modules.tools.authorlist.determine_aff_type(text)[source]

Guess format for affiliations. Return corresponding search pattern.

inspirehep.modules.tools.authorlist.determine_aff_type_character(char_list)[source]

Guess whether affiliation are by number, letter or symbols (e.g. dagger). Numbers and letters should not be mixed.

inspirehep.modules.tools.authorlist.parse_affiliations(text)[source]

Determine how affiliations are formatted. Return hash of id:affiliation

Allowed formats: don’t mix letters and numbers, lower-case letters only

1 CERN, Switzerland 2 DESY, Germany

1 CERN, Switzerland 2DESY, Germany

a CERN, Switzerland bb DESY, Germany

CERN, Switzerland # DESY, Germany

inspirehep.modules.tools.authorlist.parse_authors(text, affiliations)[source]

Parse author names and convert to Lastname, Firstnames. Can be separated by ‘,’, newline or affiliation tag. Returns: List of tuples: (author_fullname, [author_affiliations]) List of strings: warnings

inspirehep.modules.tools.authorlist.split_id(word)[source]

Separate potential aff-ids . E.g.: ‘12%$’ -> [‘‘, ‘12’ ‘%’, ‘$’]

inspirehep.modules.tools.bundles module

Tools bundles.

inspirehep.modules.tools.ext module

Tools extension.

class inspirehep.modules.tools.ext.InspireTools(app=None)[source]

Bases: object

init_app(app)[source]

inspirehep.modules.tools.utils module

Utility functions for various tools.

inspirehep.modules.tools.utils.authorlist(text)[source]

Return an author-structure parsed from text and optional additional information.

inspirehep.modules.tools.views module

Tools views.

class inspirehep.modules.tools.views.InputTextForm(*args, **kwargs)[source]

Bases: inspirehep.modules.forms.form.INSPIREForm

Input form class.

author_string = <UnboundField(TextAreaField, ('Author string',), {'render_kw': {'rows': 10, 'cols': 50}})>
inspirehep.modules.tools.views.authorlist_form()[source]

Render the authorlist page for formatting author strings.

inspirehep.modules.tools.views.tools_page()[source]

Render the splash page for list of tools.

Module contents

Tools module.