A Python module for the Puush (http://puush.me/) API.
puush.py is a Python library for interfacing with Puush, a file host, web app, and desktop app with a great quick-upload screenshot feature. It’s very simple to use:
import puush account = puush.Account("my_api_key") account.upload("super_cool_picture.png")
To use puush.py, you will need either login credentials (e-mail and password), or an API key, which can be obtained from your account settings page.
Simply install it with pip, as following:
pip install puush.py
Mainly, you will be using the puush.Account class. It uses puush.File objects, however, so both of these are detailed below. On failure, all methods raise a puush.PuushError.
Initialize an Account using either an API key or login credentials:
# With API key account = puush.Account("my_api_key") # With login credentials account = puush.Account("firstname.lastname@example.org", "bestpassword")
If the API key or credentials are invalid, a puush.AuthenticationError (which subclasses puush.PuushError) will be raised.
Upload a file to the Puush account. The only parameter, f, can be either a path to a file or a file-like object. Return a puush.File.
Delete the file with the ID id from the Puush account.
Also consider using puush.File.delete if you already have a File.
Get the 100x100px thumbnail of the file with the ID id, and return its raw PNG data.
Also consider using puush.File.thumbnail if you already have a File.
Return a list of the Puush account’s last 10 (or fewer, if the account has fewer) uploads. Each entry is a puush.File.
puush.File(id, url, filename, upload_time, views)
A file uploaded to Puush. Not meant to be initialized outside of the library.
Delete the file from Puush.
Get the 100x100 thumbnail of the file. Return the raw PNG data.
The Puush ID of the uploaded file. Is unique to the file, and can be used with puush.Account methods.
The URL to access the file.
The file’s original filename.
The file’s upload time, formatted “YYYY-MM-DD HH:MM:SS”.
How many times the file has been accessed.
If there’s a bug with the library or a feature you’d like, please open an issue on GitHub.
If you want to ask questions about the library, or just want to talk to me about… anything, really, you can do so through any of these:
To get a quick answer, Twitter is your best bet.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|puush.py-1.1.0-py2.py3-none-any.whl (8.4 kB) Copy SHA256 hash SHA256||Wheel||2.7||Jan 31, 2016|
|puush.py-1.1.0.zip (11.6 kB) Copy SHA256 hash SHA256||Source||None||Jan 31, 2016|