Top Level

The codepost_powertools package.

codepost_powertools.log_in_codepost(config_file='config.yaml', *, log=False)

Logs in to codePost using the api key in the YAML config file.

The api key will be searched for in a field called "api_key" in the config file.

Note that all the functions in this package will not call this method for you, so you should be calling it yourself at the start of your script. If you are using the command line, this method is called before each command.

Parameters:
  • config_file (PathLike) – The config file to read.

  • log (bool) – Whether to show log messages.

Returns:

Whether successfully logged in.

Return type:

bool

Raises:
  • FileNotFoundError – If the config file is not found.

  • RuntimeError – If the config file cannot be read (likely due to an invalid format).

  • KeyError – If the YAML config file does not contain the "api_key" key.

  • ValueError – If the given api key is invalid.

New in version 0.1.0.

Info

Info about the codepost-powertools package.

codepost_powertools.info.package_name: str

The default package name (tries to set from __package__ with a fallback).

codepost_powertools.info.version_info: Tuple[int, int, int]

The version info as a tuple of ints.

codepost_powertools.info.__version__: str

The version as a string.

codepost_powertools.info.github_url: str

A link to the GitHub repo.

codepost_powertools.info.docs_url: str

A link to the stable package documentation.

codepost_powertools.info.docs_version_url: str

A link to the package documentation for the current version.