All Projects → ymyzk → python-gyazo

ymyzk / python-gyazo

Licence: MIT license
A Python wrapper for Gyazo API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-gyazo

pybind11-stubgen
Generates stubs for python modules (targeted to C++ extensions compiled with pybind11)
Stars: ✭ 103 (+543.75%)
Mutual labels:  pep561
classes
Smart, pythonic, ad-hoc, typed polymorphism for Python
Stars: ✭ 461 (+2781.25%)
Mutual labels:  pep561

python-gyazo

PyPI version PyPI Python versions CI Status Documentation Status

A Python wrapper for Gyazo API.

The full-documentation is available on Read the Docs.

Requirements

  • Python 3.5+

Installation

pip install python-gyazo

Note: Please use the latest version of setuptools & pip

pip install -U setuptools pip

Usage

At first, you must create an application and get an access token from https://gyazo.com/oauth/applications

from gyazo import Api


client = Api(access_token='YOUR_ACCESS_TOKEN')

### Get a list of images
images = client.get_image_list()
for image in images:
    print(str(image))

### Using an image model
image = images[0]
print("Image ID: " + image.image_id)
print("URL: " + image.url)

### Download an image
if image.url:
    with open(image.filename, 'wb') as f:
        f.write(image.download())

### Upload an image
with open('sample.png', 'rb') as f:
    image = client.upload_image(f)
    print(image.to_json())

### Delete an image
client.delete_image('IMAGE_ID')

### oEmbed
image = images[0]
print(client.get_oembed(image.permalink_url))

Backup

gyazo-backup is moved to python-gyazo-backup.

License

MIT License. Please see LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].