Skip to content

Documentation for PortalClient

pyportal is a asynchronous python library for submitting new jobs & downloading results of the processed jobs from Faceware Portal.

Modules:

Name Description
Project

This module descibes a way to interact with projects, i.e. creating a project, listing projects, querying jobs within a project, etc

Job

This module descibes a way to interact with jobs, i.e. querying a job status, progress, etc

JobResult

This module descibes a way to interact with job results, i.e. downloading the results

PortalClient

PortalClient(
    access_token: Optional[str] = None,
    organization_id: Optional[str] = None,
    parent_logger: Optional[Logger] = None,
)

Class responsible for getting data and creating new projects in FacewareTech Cloud Portal.

Initialize the PortalClient.

Parameters:

Name Type Description Default
access_token Optional[str]

The access token to use for authentication. Leave as None to use env var FACEWARE_PORTAL_API_ACCESS_TOKEN

None
organization_id Optional[str]

Your organization id on Portal Leave as None to use env var FACEWARE_PORTAL_ORGANIZATION_ID

None

Raises:

Type Description
AccessTokenNotFoundError

If no valid access_token is found

OrganizationIdNotFoundError

If no valid organization_id is found

create_project async

create_project(
    project_name: str,
    project_description: Optional[str] = None,
) -> Project

Create new project in the Cloud Portal.

Parameters:

Name Type Description Default
project_name str

Your Cloud Portal project name

required
project_description Optional[str]

Short description of the project

None

Returns:

Type Description
Project

Returns the created project

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.

TypeError

If the project is failed to validate.

get_project async

get_project(project_id: str) -> Project

Get a specfic project.

Parameters:

Name Type Description Default
project_id str

Your unique project ID

required

Returns:

Type Description
Project

project

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.

get_projects async

get_projects(
    enabled: Optional[bool] = None,
) -> List[Project]

Get list of projects.

Parameters:

Name Type Description Default
enabled Optional[bool]

A boolean for filterting projects by enabled status. None will return all projects.

None

Returns:

Type Description
List[Project]

List of projects.

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.