Reference

gyazo.Api class

class gyazo.Api(client_id=None, client_secret=None, access_token=None, api_url='https://api.gyazo.com', upload_url='https://upload.gyazo.com')

Bases: object

A Python interface for Gyazo API

delete_image(image_id)

Delete an image

Parameters:image_id – Image ID
get_image_list(page=1, per_page=20)

Return a list of user’s saved images

Parameters:
  • page – (optional) Page number (default: 1)
  • per_page – (optional) Number of images per page (default: 20, min: 1, max: 100)
get_oembed(url)

Return an oEmbed format json dictionary

Parameters:url – Image page URL (ex. http://gyazo.com/xxxxx)
upload_image(image_file, referer_url=None, title=None, desc=None, created_at=None, collection_id=None)

Upload an image

Parameters:
  • image_file – File-like object of an image file
  • referer_url – Referer site URL
  • title – Site title
  • desc – Comment
  • created_at – Image’s created time in unix time
  • collection_id – Collection ID

gyazo.GyazoError class

class gyazo.GyazoError

Bases: Exception

Base class for Gyazo errors

gyazo.Image class

class gyazo.Image(**kwargs)

Bases: object

A class representing an image of Gyazo

created_at = None

The time this image was created

download()

Download an image file if it exists

Raises:GyazoError
download_thumb()

Download a thumbnail image file

Raises:GyazoError
filename

An image filename

Getter:Return an image filename if it exists
static from_dict(data)

Create a new instance from dict

Parameters:data – A JSON dict
image_id = None

An image ID

local_created_at

The time this image was created in local time zone

Getter:Return the time this image was created in local time zone

A permalink URL

thumb_filename

A thumbnail image filename

Getter:Return a thumbnail filename
thumb_url = None

A thumbnail URL

to_dict()

Return a dict representation of this instance

to_json(indent=None, sort_keys=True)

Return a JSON string representation of this instance

Parameters:
  • indent – specify an indent level or a string used to indent each level
  • sort_keys – the output is sorted by key
type = None

A type of the image

url = None

An image URL

gyazo.ImageList class

class gyazo.ImageList(**kwargs)

Bases: object

A class representing a list of gyazo.Image

current_page = None

Current page number

static from_list(data)

Create a new instance from list

Parameters:data – A JSON list
has_next_page()

Whether there is a next page or not

Getter:Return true if there is a next page
has_previous_page()

Whether there is a previous page or not

Getter:Return true if there is a previous page
images = None

List of images

num_pages

The number of pages

Getter:Return the number of pages
per_page = None

The number of images per page

set_attributes_from_headers(headers)

Set instance attributes with HTTP header

Parameters:headers – HTTP header
to_json(indent=None, sort_keys=True)

Return a JSON string representation of this instance

Parameters:
  • indent – specify an indent level or a string used to indent each level
  • sort_keys – the output of dictionaries is sorted by key
total_count = None

The number of images

user_type = None

User type