Skip to content

module pephubclient.modules.view

Global Variables

  • PEPHUB_VIEW_URL
  • PEPHUB_VIEW_SAMPLE_URL

class PEPHubView

Class for managing views in PEPhub and provides methods for getting, creating, updating and removing views.

This class aims to warp the Views API for easier maintenance and better user experience.

method __init__

__init__(jwt_data: str = None)
  • :param jwt_data: jwt token for authorization

method add_sample

add_sample(
    namespace: str,
    name: str,
    tag: str,
    view_name: str,
    sample_name: str
)

Add sample to view in project in PEPhub.

  • :param namespace: namespace of project
  • :param name: name of project
  • :param tag: tag of project
  • :param view_name: name of the view
  • :param sample_name: name of the sample

method create

create(
    namespace: str,
    name: str,
    tag: str,
    view_name: str,
    description: str = None,
    sample_list: list = None,
    no_fail: bool = False
)

Create view in project in PEPhub.

  • :param namespace: namespace of project
  • :param name: name of project
  • :param tag: tag of project
  • :param description: description of the view
  • :param view_name: name of the view
  • :param sample_list: list of sample names
  • :param no_fail: whether to raise an error if view was not added to the project

method delete

delete(namespace: str, name: str, tag: str, view_name: str)  None

Delete view from project in PEPhub.

  • :param namespace: namespace of project
  • :param name: name of project
  • :param tag: tag of project
  • :param view_name: name of the view :return: None

method get

get(
    namespace: str,
    name: str,
    tag: str,
    view_name: str,
    raw: bool = False
)  Union[Project, dict]

Get view from project in PEPhub.

  • :param namespace: namespace of project
  • :param name: name of project
  • :param tag: tag of project
  • :param view_name: name of the view
  • :param raw: if True, return raw response :return: peppy.Project object or dictionary of the project (view)

method remove_sample

remove_sample(
    namespace: str,
    name: str,
    tag: str,
    view_name: str,
    sample_name: str
)

Remove sample from view in project in PEPhub.

  • :param namespace: namespace of project
  • :param name: name of project
  • :param tag: tag of project
  • :param view_name: name of the view
  • :param sample_name: name of the sample :return: None

This file was automatically generated via lazydocs.