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:
objectBroodClientis the top level entry point into thehatcherAPI.-
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
namewith the descriptiondescription.Parameters: 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
BroodClientfrom a Brood URL and pre-configuredrequests.Sessioninstance.
-
classmethod
from_url(url, auth=None, verify_ssl=True, api_version=0)¶ Create a
BroodClientfrom 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,createdandlast_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 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. IfTrue, 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¶
-
exception
hatcher.errors.HatcherException¶ Bases:
Exception
-
exception
hatcher.errors.InvalidRuntime¶
-
exception
hatcher.errors.MissingFilenameError¶
-
exception
hatcher.errors.MissingPlatformError¶
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:
objectA 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.
-