Skip to main content

Upload images to imgbox.com

Project description

  • CLI tool

    $ imgbox foo.jpg bar.png --title "My Gallery" --thumb-width 500
    
  • Shell script to generate BBCode

    imgbox --json --thumb-width 350 "$@" > upload.json
    echo "[url=$(jq -r '.gallery_url' < upload.json)]Gallery[/url]"
    echo "[url=$(jq -r '.edit_url' < upload.json)]Edit Gallery[/url]"
    while read image; do
        image_url=$(jq -r '.image_url' <<< "$image")
        thumbnail_url=$(jq -r '.thumbnail_url' <<< "$image")
        echo "[url=$image_url][img]$thumbnail_url[/img][/url]"
    done <<< $(jq -c '.images[]' upload.json)
    
  • Python

    import pyimgbox
    import pprint
    files = ("this.jpg", "and/that.png")
    gallery = pyimgbox.Gallery(title="Hello, World!")
    try:
        gallery.create()
    except ConnectionError as e:
        print('Oh no!', str(e))
    else:
        print('Gallery URL:', gallery.url)
        print(    Edit URL:', gallery.edit_url)
        for submission in gallery.add(*files):
            pprint.pprint(submission)
    

Installation

$ sudo apt install pipx
$ pipx install --upgrade pyimgbox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyimgbox-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

pyimgbox-0.2.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file pyimgbox-0.2.0.tar.gz.

File metadata

  • Download URL: pyimgbox-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for pyimgbox-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ee29477d8c0d58558ea181212ad258a469958c79013dcb6e8b1c804284a334d0
MD5 7c669f56acc9a1f18cf27e147cc3ec76
BLAKE2b-256 42739d9e4275a80743162ff714d6c513e9a1effe1eefa2546f9c394a93c109a9

See more details on using hashes here.

File details

Details for the file pyimgbox-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyimgbox-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for pyimgbox-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 175ac6eb34558d6fffb7b58391e30adbe135a688ae159842d2c49b3a0385893e
MD5 6e71be2096d25bd9af82d2a84227e553
BLAKE2b-256 300a571205e595450ba013e2a5d0aff4935312d3e669f20f018544f4de3a6337

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page