A package for uploading and deleting files using AnonDrop API
Project description
AnonDrop Package
AnonDrop is a Python package that allows users to upload and delete files using the AnonDrop service. This package provides a simple interface for file management, making it easy to integrate file uploads into your applications.
Features
- Upload files to AnonDrop with ease.
- Delete files from AnonDrop using their unique file ID.
- Simple and intuitive API.
Installation
You can install and update the AnonDrop package using pip:
pip install --upgrade anondrop
Usage
Getting Client ID
Head to the AnonDrop Dashboard and click your Client Key in the top left
Uploading a File
To upload a file, you need to set your Client Key and call the upload function:
import anondrop
anondrop.setClientKey('your_client_key_here') # anondrop.setClientID will soon be deprecated to match the website
file_path = 'path/to/tag.sk'
uploaded_file = anondrop.upload(file_path)
print(f"File URL: {uploaded_file.fileurl}")
# File URL: https://anondrop.net/1369090222146457662/tag.sk
print(f"File ID: {uploaded_file.fileid}")
# File ID: 1369090222146457662
print(f"URL: {uploaded_file.filepage}")
# File ID: https://anondrop.net/1369090222146457662
Uploading a file with a custom name
Do the same as before, but this time add filename="filename.ext"
import anondrop
anondrop.setClientKey('your_client_key_here')
file_path = 'path/to/tag.sk'
uploaded_file = anondrop.upload(file_path, filename="TagGame.sk")
print(f"File URL: {uploaded_file.fileurl}")
# File URL: https://anondrop.net/1402101757731012719/TagGame.sk
print(f"File ID: {uploaded_file.fileid}")
# File ID: 1402101757731012719
print(f"URL: {uploaded_file.filepage}")
# File ID: https://anondrop.net/1402101757731012719
Uploading a file with a custom chunksize
Do the same as the first, but this time add chunksize=size in MB
import anondrop
anondrop.setClientKey('your_client_key_here')
file_path = 'path/to/tag.sk'
uploaded_file = anondrop.upload(file_path, chunksize=25)
print(f"File URL: {uploaded_file.fileurl}")
# File URL: https://anondrop.net/1369090222146457662/tag.sk
print(f"File ID: {uploaded_file.fileid}")
# File ID: 1369090222146457662
print(f"URL: {uploaded_file.filepage}")
# File ID: https://anondrop.net/1369090222146457662
Uploading a File Remotely
To upload a remote file, first have your Client Key set, then call the remoteUpload function:
import anondrop
anondrop.setClientKey('your_client_key_here')
link = 'https://raw.githubusercontent.com/BubblePlayzTHEREAL/AnonDrop/refs/heads/main/setup.py'
uploaded_file = anondrop.remoteUpload(link)
print(f"File URL: {uploaded_file.fileurl}") # The url is not returned so this doesnt work.
# File URL: None
print(f"File ID: {uploaded_file.fileid}")
# File ID: 1378090451105484880
print(f"URL: {uploaded_file.filepage}")
# File ID: https://anondrop.net/1378090451105484880
Deleting a File
To delete a file, use the delete function with the file ID:
import anondrop
anondrop.setClientKey('your_client_key_here')
file_id = 'your_file_id_here'
anondrop.delete(file_id)
print("File deleted successfully.")
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anondrop-0.2.2.tar.gz.
File metadata
- Download URL: anondrop-0.2.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
031a9452c6741e50d549820842f65e9344ce53f8b5dbef6789ef3a3c2994bf6a
|
|
| MD5 |
d7144ae5c582df7653d4b4a815aef7cb
|
|
| BLAKE2b-256 |
46d82ec6b5e8200168443628d16077b44142d10505808db4ef423b708c9481e1
|
File details
Details for the file anondrop-0.2.2-py3-none-any.whl.
File metadata
- Download URL: anondrop-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38b1db140c968bf4033884eb733f60c4830e40b1360769b0b93e3cc1ac5d5f0c
|
|
| MD5 |
5f382f720ed41172e3e549148c58d091
|
|
| BLAKE2b-256 |
27b0cb27565e54e905800a92f5d072e9217207df54521d6dd2411e55407c5a75
|