Skip to main content

An unofficial wrapper for the freeimagehost website api.

Project description

FreeImageHost

Unofficial wrapper for the freeimagehost website api

Install

$ python3 -m pip install freeimagehost

Example

from imagehost import ImageHost

cl = ImageHost('api_key...')

#local image
image = cl.upload(
    'image.png'
)

#url image
image2 = cl.upload(
    'https://example.com/image.png',
    'url'
)

#base64 image
image3 = cl.upload(
    'b64 string...',
    'b64'
)

print(image['image']['url'])
print(image2['image']['url'])
print(image3['image']['url'])

Asyncio Example

import asyncio
from imagehost.aio import ImageHost

async def main():
    cl = ImageHost('api_key....')
    
    #local image
    image = await cl.upload(
        'image.png'
    )
    
    #url image
    image2 = await cl.upload(
        'https://example.com/image.png',
        'url'
    )
    
    #base64 image
    image3 = await cl.upload(
        'b64 string...',
        'b64'
    )
    
    print(image['image']['url'])
    print(image2['image']['url'])
    print(image3['image']['url'])


asyncio.run(main())

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

freeimagehost-1.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

freeimagehost-1.2-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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