Skip to main content

An API wrapper for UploadGram

Project description

PyUploadGram

An API wrapper for UploadGram

Installation

not on pyPi soo..

git clone https://github.com/scrubjay55/PyUploadGram
pip3 install ./PyUploadGram

Usage

import PyUploadGram

pyuploadgram_sesh = PyUploadGram.Session()

b_somephoto = open(r"./somephoto.jpeg", 'rb').read()
uploaded_file = pyuploadgram_sesh.upload_file(filename="some photo.jpeg",
                                              file=b_somephoto
                                              )
# OR
uploaded_file2 = pyuploadgram_sesh.upload_file(filename="some photo2.jpeg",
                                               file=r"./somephoto.jpeg"
                                               )
print(uploaded_file)
# (UploadedFile: url=https://dl.uploadgram.me/********?raw, delete=******)

# DIRECTLY FROM THE INTERNET
some_media_u = pyuploadgram_sesh.upload_file(filename="some media.jpg",
                                             file="https://i.redd.it/xxxxxxx.jpg"
                                             )
# OR
b_some_media = requests.get("https://i.redd.it/xxxxxxx.jpg").content
some_media_u2 = pyuploadgram_sesh.upload_file(filename="some media.jpg",
                                              file=b_some_media
                                              )

is_succesfully_deleted = pyuploadgram_sesh.delete_file(uploaded_file)
print(is_succesfully_deleted)
# True
print(pyuploadgram_sesh.uploaded_files)

# ALSO POSSIBLE WITHOUT A SESSION
PyUploadGram.upload_file(filename="some file.o",
                         file=r"./someobj.o"
                         )

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

PyUploadGram-1.0.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

PyUploadGram-1.0.0-py3-none-any.whl (6.9 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