A Python Wrapper for the im-a-dev.xyz uploader.
Project description
iad
iadpy is a wrapper for the Im A Dev file uploader in python.
- Async wrapper (
async
,await
) - Proper rate limiting
Usage
Installation
Pypi
pip install iad.py
From GitHub
pip install git+https://github.com/Fxcilities/iad.py.git
Examples
- Upload an image
from iad import ImADev
from asyncio import get_event_loop
uploader = ImADev('token here')
async def main():
with open('image.png', 'rb') as f:
read = f.read()
options = ('png', read)
upload = await uploader.upload(options)
print(upload.url)
loop = get_event_loop()
loop.run_until_complete(main())
- Getting a upload information
from iad import ImADev
from asyncio import get_event_loop
uploader = ImADev('token here')
async def main():
upload = await uploader.get_upload('filename.png')
print(upload.url)
loop = get_event_loop()
loop.run_until_complete(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
iad.py-1.0.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
iad.py-1.0.2-py3-none-any.whl
(5.4 kB
view hashes)