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
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file PyUploadGram-1.0.0.tar.gz
.
File metadata
- Download URL: PyUploadGram-1.0.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19a1def2ea7d52b5bcc0637438161c56777207b910ca8b0882f07aaca783aceb |
|
MD5 | 484f3382e330d7f06c743dce934e3cb2 |
|
BLAKE2b-256 | 474f4b6249b647a580d6115c515bcb7977fd708b6b9b699ab2b1a63ff57484e4 |
File details
Details for the file PyUploadGram-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: PyUploadGram-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54de13add0f9c4b974fc43304094dae61d7f6bc86c1221f415b9ac72d59529c7 |
|
MD5 | caf0d11796148bcadc7a04cde40808f2 |
|
BLAKE2b-256 | 2f88d084ec303dbc1f0a05b143f0d9a9df11f7892a0e6d6debb508b069863f22 |