UploadgramPyAPI
This API can upload, download, remove and rename any files from the service uploadgram.me - a simple and fast file uploader that uses Telegram network as file storage.
If you download this module, you confirm your agreement with the Terms of Service and DMCA Policy of Uploadgram.me
Author: tankalxat34
Install
In your CMD perform this command:
pip install UploadgramPyAPI
Quickstart
Upload any file
import UploadgramPyAPI
up_file = UploadgramPyAPI.NewFile("D:\\image.jpg")
up_file.upload()
Delete any file
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
up_file.delete()
Rename any file
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
up_file.rename("ItsNewNameForFile.jpg")
Download any file
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
up_file.download()
Using
Now we can looking, how to use UploadgramPyAPI
Upload new file
Step 1
Firstly, you need to import the library:
import UploadgramPyAPI
Step 2
Next if you want to upload new file on uploadgram.me you need write this in your file:
up_file = UploadgramPyAPI.NewFile("D:\\image.jpg")
This string will preparing your file to upload.
Step 3
Write this line after the previous one.
up_file.upload()
Now file image.jpg was uploaded in uploadgram.me and you was get the dictionary like here
{
"ok": "true",
"url": "https://dl.uploadgram.me/611e5e6237f6fg",
"delete": "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g"
}
UploadgramPyAPI can parse this json-responce and create new attributes: url, key and url_import.
Important thing
Attribute key is a very important string for renaming and removing the file. You need to save its, else you won't do it.
Attribute url_import it's a simple url for import your file in a dashboard in https://dl.uploadgram.me.
Its look like this:
https://uploadgram.me/upload/#import:{"e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g": {"filename": "image.jpg", "size": 55604, "url": "https://dl.uploadgram.me/611e5e6237f6fg"}}
Open this url in your browser and uploaded file will appear on the website! You can see something like this:
So your code can be looking like this:
import UploadgramPyAPI
up_file = UploadgramPyAPI.NewFile("D:\\image.jpg")
up_file.upload()
Delete file
Also you can delete the file. Look!
Step 1
If you have the key attribute for the file, you can delete its!
Firstly, you need to write this strings for connect to server and file on it:
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
up_file.delete()
Last string deleted the image.jpg from uploadgram.me. If you want to make sure, you can open url in your browser. You will get the 404-error:
Rename file
UploadgramPyAPI can rename the file.
We need use the key attribute for rename the file.
The beginning is the same as in the previous steps:
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
# this string will rename the filename
up_file.rename("ItsNewNameForFile.jpg")
And now you can see this situation:
Download file
You can download the file from server:
import UploadgramPyAPI
up_file = UploadgramPyAPI.File("611e5e6237f6fg", "e3da26e9dddd2e01b8c0831370695e9088a96ff81e262fc2g")
# this string will help download the file in the default download's folder
up_file.download()
File will appear in the download's folder:
Also you can write path to save file:
up_file.download("D:\\MyMainFolder\\")
It's enough! Successful use of the UploadgramPyAPI library!
Metadata
Release files for uploadgrampyapi 1.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| UploadgramPyAPI-1.6.1.tar.gz | 6.7 kB | Without provenance | Details for UploadgramPyAPI-1.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| UploadgramPyAPI-1.6.1-py3-none-any.whl | Python 3 | none | any | Details for UploadgramPyAPI-1.6.1-py3-none-any.whl |
Total release size: 12.9 kB
Release files / UploadgramPyAPI-1.6.1.tar.gz
| Download URL | UploadgramPyAPI-1.6.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5db196cdd4dddb38516ca90ec5abb918f178f7e2d41793faf8c4a72a116ecfee
|
|
BLAKE2b-256 checksum How to use checksums |
4032f16cc8249bf9fc5f19ffe8cbce7fb8d01945b2d73eb678885516ffe6d69e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.8 CPython/3.9.5 Windows/10
|
Release files / UploadgramPyAPI-1.6.1-py3-none-any.whl
| Download URL | UploadgramPyAPI-1.6.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3699adc29113aecb9bbf32858d82315ce7646fdf08437bf71f9463197130c33
|
|
BLAKE2b-256 checksum How to use checksums |
20f8449b917efa1864bdc253a23037a6a4b63be2c70ccd0e320ec59b20f49edd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.8 CPython/3.9.5 Windows/10
|
Security for uploadgrampyapi 1.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.