
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Anonfile Uploader is a simple Python library to upload files to Anonfile.la, including its temporary storage feature.
pip install anonfile-uploader
from anonfile import Anonfile
anonfile = Anonfile()
link = anonfile.upload_file('path/to/your/file.jpg')
print(f"Uploaded File: {link['url']}")
The library comes with built-in exception handling to manage common errors such as timeouts, connection issues, or Json errors, others errors.
from anonfile import Anonfile
from anonfile.exceptions import TimeoutError, ConnectionError, JsonDecodeError, AnonfileError
uploader = Anonfile(email="your_email@example.com", password="your_password")
try:
file_path = "path/to/your/file.txt"
response = uploader.upload_file(file_path)
print(f"Upload File: response['url']")
except TimeoutError:
print("The upload took too long and timed out.")
except ConnectionError:
print("Failed to connect to the server.")
except JsonDecodeError as e:
print(f"Error: {str(e)}")
except AnonfileError as e:
print(e)
If the upload takes too long and exceeds the specified timeout, a TimeoutError will be raised.
from anonfile import Anonfile
from anonfile.exceptions import TimeoutError
uploader = Anonfile(email="your_email@example.com", password="your_password")
try:
link = uploader.upload_file('path/to/your/file.jpg', timeout=10)
print(f"Uploaded file: {link['url']}")
except TimeoutError:
print("The upload took too long and timed out.")
If there's a problem connecting to the anonfile.la , a ConnectionError will be raised.
from anonfile import Anonfile
from anonfile.exceptions import ConnectionError
uploader = Anonfile(email="your_email@example.com", password="your_password")
try:
link = uploader.upload_file('path/to/your/file.jpg')
print(f"Uploaded file: {link['url']}")
except ConnectionError:
print("Failed to connect to the server.")
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A simple Python library to upload files to anonfile.la
We found that anonfile-uploader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.