bluesearch.entrypoint.database.download module

Download articles from different sources.

convert_to_datetime(s: str) datetime.datetime[source]

Try to convert a string to a datetime.

Parameters

s – String to be check as a valid date.

Returns

The date specified in the input string.

Return type

datetime

Raises

ArgumentTypeError – When the specified string has not a valid date format.

init_parser(parser: argparse.ArgumentParser) argparse.ArgumentParser[source]

Initialise the argument parser for the download subcommand.

Parameters

parser – The argument parser to initialise.

Returns

The initialised argument parser. The same object as the parser argument.

Return type

argparse.ArgumentParser

run(source: str, from_month: datetime.datetime, output_dir: pathlib.Path, dry_run: bool) int[source]

Download articles of a source from a specific date.

Parameter description and potential defaults are documented inside of the get_parser function.