lib package

Submodules

lib.mail module

class lib.mail.Mail(client_secrets_path: str, token_path: str)

Bases: object

Mail Client Object.

Parameters
  • client_secrets_path – OAuth 2.0 Client Secrets Path

  • token_path – ID Token Path

static create_message(to: str, subject: str, body: str) Dict

Create email message.

Parameters
  • to – email message to

  • subject – email message subject

  • body – email message body

Returns

A raw data for email.mime.text decode dict.

static create_message_with_image(to: str, subject: str, body: str, file_path_list: List[str]) Dict

Create email message with image.

Parameters
  • to – email message to

  • subject – email message subject

  • body – email message body

  • file_path_list – email image file path list

Returns

A raw data for email.mime.multipart decode dict.

send_message(body: Dict) Dict

Send email message.

Parameters

body – email message body

Returns

Google email send response message.

lib.mail.debug() None

debug function.

lib.photo_library module

class lib.photo_library.PhotoLibrary(client_secrets_path: str, token_path: str)

Bases: object

PhotoLibrary Client Object.

Parameters
  • client_secrets_path – OAuth 2.0 Client Secrets Path

  • token_path – ID Token Path

create_album(album_title: str) str

Create a new album.

Parameters

album_title – New album title name

Returns

A newly created album ID.

get_album(album_title: str) Optional[Dict]

Get a target album.

Parameters

album_title – album title

Returns

An Album Resources dictionary.

get_album_list() List

Return all albums structure list.

Returns

All albums structure list.

get_media_dict(album_id: str, filter_name: Optional[str] = None) Dict

Return album media information dict.

Parameters
  • album_id – Album ID

  • filter_name – filter media name

Returns

Album media information dict.

upload_image(album_id: str, image_path: str) bool

Upload images to album.

Parameters
  • album_id – Album ID

  • image_path – Image path to upload

Returns

Returns whether the image could be uploaded.

lib.photo_library.debug() None

debug function.

lib.spread_sheet module

class lib.spread_sheet.SpreadSheet(service_account_path: str, spread_sheet_key: str)

Bases: object

SpreadSheet Client Object.

Parameters
  • service_account_path

  • spread_sheet_key

append_row(values: List, index: int = 0) Dict

Append Google spreadsheet row at the end.

Parameters
  • values – Input values list

  • index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet input response message.

clear(index: int = 0) Dict

Clear Google spreadsheet all rows at once.

Parameters

index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet clear response message.

col_values(col: int, index: int = 0) List

Get Google spreadsheet all column values.

Parameters
  • col – Google spreadsheet column. (ex) 1

  • index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet all column values.

get_all_values(index: int = 0) List

Get Google spreadsheet all sheet values.

Parameters

index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet all sheet values.

get_label_value(label: str, index: int = 0) str

Get Google spreadsheet label value.

Parameters
  • label – Google spreadsheet label. (ex) “A1”

  • index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet label value.

row_values(row: int, index: int = 0) List

Get Google spreadsheet all row values.

Parameters
  • row – Google spreadsheet row. (ex) 1

  • index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet all row values.

set_label_value(label: str, value: str, index: int = 0) Dict

Set Google spreadsheet label value.

Parameters
  • label – Google spreadsheet label. (ex) “A1”

  • value – Input value

  • index – Google spreadsheet tab index. (ex) 0

Returns

Google spreadsheet input response message.

lib.spread_sheet.debug() None

debug function.

Module contents