Skip to content

Latest commit

 

History

History
132 lines (102 loc) · 4.59 KB

README.md

File metadata and controls

132 lines (102 loc) · 4.59 KB

About

The anonpy module makes it easier to communicate with REST APIs for anonymously uploading and downloading files. It implements an extensible provider-independent class system and also comes with an intuitive CLI or lightweight GUI for interactive usage.

⚠ This project is still a work in progress. Keep an eye on the Roadmap, which documents the progress path toward the first major release.

Documentation for this project can be found on the GitHub Wiki pages.

Installation

⚠ It is currently not possible to install this library with pip yet.

This library can be installed with:

pip install anonpy

Alternatively, use the pipx command if you intend to use anonpy solely from the command line:

pipx install anonpy

Library

AnonPy can be used to interface with a wide variety of REST services by building a contract with the Endpoint class.

from anonpy import AnonPy, Endpoint

api = "https://pixeldrain.com/api/"
endpoint = Endpoint(upload="/file", download="file/{}", preview="/file/{}/info")

anon = AnonPy(api, endpoint)

# retrieve resource meta data without committing to a download
preview = anon.preview("LNcXZ9UM")
print(f"{preview=}")

# download a resource to the current working directory
download = anon.download("LNcXZ9UM", progressbar=True)
print(f"{download=}")

# upload a file
upload = anon.upload("homework.docx", progressbar=True)
print(f"{upload=}")

Command Line Interface

Read the help manual:

anonpy --help

Graphical User Interface

Launch a graphical user interface for uploading and downloading files:

anonpy --gui

Acknowledgements

Historically speaking, this module can be considered a continuation of the anonfile-api project, although any resemblance of compatibility may only be temporary. On 16 August 2023, the anonymous file sharing website https://anonfiles.com shut down due to overwhelming abuse by the community, which was the driving factor for creating a backend-agnostic library that can stand the test of time. That's why to this day, anonpy still uses the anonfiles logo as a small nod to its past.

Special thanks to @aaronlyy for passing on the PyPI name anonpy to @StefanGreve.

See also the list of contributors who participated in the development of this project.

Further Reading

This Project is licensed under the MIT license. Check out the Contributing Guidelines to learn more about how you can help this project grow. Navigate to the Discussions panel to ask questions or make feature requests.