Skip to main content

imgur-uploader

A simple command line client for uploading files to Imgur.

Created for my PyCon US 2015 Docker tutorial so that students using my cloud servers can see the gifs they create at the end of exercise 1.

This tool is open source under the MIT License.

Quickstart

Getting Imgur API credentials

Go to https://api.imgur.com/oauth2/addclient and register a new Imgur API client. You will need an Imgur account to do this.

You can put it any valid URL for the callback URL - we won’t be using it.

Installing imgur-uploader

Installing imgur-uploader is easy. It runs on versions of Python >=2.7 or >=3.3.

If you just want to use imgur-uploader, you can just pip install imgur-uploader.

If you want to tweak or enhance imgur-uploader, follow these instructions:

  1. Clone this repository

  2. Install the tool with pip install -e .

Using imgur-uploader

First, create a file called ~/.config/imgur_uploader/uploader.cfg, with the following contents (substitute your credentials):

[imgur]
id = 9354da9ecdcfae3
secret = 8387eca75687ecad9876ead47786edac0875dc0d

Otherwise, set the IMGUR_API_ID and IMGUR_API_SECRET environment variables in your terminal session, using your client’s credentials.

Upload an image by running imgur-uploader path/to/my.gif

The tool will return a shortened link to your uploaded gif upon completion:

Uploading file my.gif
...
File uploaded - see your gif at http://i.imgur.com/6WsQPpw.gif

If you want your images to appear in your account, you additionally need to get a refresh token. See the Imgur API <https://apidocs.imgur.com/#authorization-and-oauth> for information on how to obtain this. Then, add a refresh_token line in your config file:

[imgur]
id = 9354da9ecdcfae3
secret = 8387eca75687ecad9876ead47786edac0875dc0d
refresh_token = 9812398ab1b2cc98de9fa982bacd31cb312c6194

Release files for imgur-uploader 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imgur-uploader 0.3.0
File Size Uploaded
imgur-uploader-0.3.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imgur-uploader 0.3.0
File Interpreter ABI Platform
imgur_uploader-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 7.4 kB

Release files / imgur-uploader-0.3.0.tar.gz

Download URL imgur-uploader-0.3.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8dc20a86699e089c774c0191f15616f8631f0ace5f2c8a6beb928e2892a51cca
BLAKE2b-256 checksum
How to use checksums
78dedd747677175223dee35a65b14a8a5d160032d55d3c2903ac1def204b4c55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

Release files / imgur_uploader-0.3.0-py2.py3-none-any.whl

Download URL imgur_uploader-0.3.0-py2.py3-none-any.whl
Size 3.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
fc5289e92007b297464da0c86fea6f12f9ca849d4b0e944b76762dd353f109a1
BLAKE2b-256 checksum
How to use checksums
7d8953afedf50535642ca2cc768121c8a820d2e16b3fb3dedae92dc0f5d89ee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page