The hatcher package

hatcher.api module

class hatcher.api.BroodBearerTokenAuth(token)

Bases: requests.auth.AuthBase

class hatcher.api.BroodClient(url_handler, api_version=0)

Bases: object

BroodClient is the top level entry point into the hatcher API.

create_api_token(name)

Create a new API token for the current user.

Parameters:name (str) – The name for the new token.
Returns:token (dict) – Dict containing the token and its name.
create_organization(name, description)

Create a new organization called name with the description description.

Parameters:
  • name (str) – The name of the organization.
  • description (str) – The description of the organization.

Returns Organization

delete_api_token(name)

Delete the user’s named API token.

Parameters:name (str) – The name of the token to delete.
classmethod from_session(url, session, api_version=0)

Create a BroodClient from a Brood URL and pre-configured requests.Session instance.

classmethod from_url(url, auth=None, verify_ssl=True, api_version=0)

Create a BroodClient from a Brood URL and authentication information.

list_api_tokens()

List the metadata of user’s API tokens.

Note

This does not list the actual token that can be used for authentication, just the metadata name, created and last_used.

Returns:tokens (list) – List of metadata for all of the user’s active tokens.
list_available_repositories()
list_organizations()

List all organizations in the brood server.

list_platforms()

List all platforms supported by the Brood server.

Returns:platforms (list) – List of platform names.
list_python_tags(list_all=False)

List PEP425 Python Tags supported by the Brood server.

Parameters:list_all (bool) – If False (default), will only list the tags that correspond to an actual Python implementation and version. If True, list all possible tags.
Returns:tags (list) – List of Python tags.
organization(name)

Get an existing organization.

Parameters:name (str) – The name of the organization.

Returns Organization

hatcher.errors module

exception hatcher.errors.ChecksumMismatchError

Bases: hatcher.errors.HatcherException

exception hatcher.errors.HatcherException

Bases: Exception

exception hatcher.errors.InvalidRuntime

Bases: hatcher.errors.HatcherException

exception hatcher.errors.MissingFilenameError

Bases: hatcher.errors.HatcherException

exception hatcher.errors.MissingPlatformError

Bases: hatcher.errors.HatcherException

hatcher.utils module

hatcher.utils.command_tree_option(*param_decls, **attrs)

A decorator to add the command tree option.

Adds an option –command-tree which prints the command tree for the given click command and exits.

This is based on the click’s version_option decorator.

class hatcher.utils.CommandTreeFormatter(indent_increment=4)

Bases: object

A helper to format the tree of click commands for printing on the console.

add_command(command)

Add a command to the tree at the current indentation level.

format(ctx, click_command)

Build the command tree starting from the provided click_command.

This is a recursive function that traverses the tree of click commands.

getvalue()

Return the formatted tree as a string.

indentation()

Context manager to control the indentation of the tree at the current command level.