Skip to main content

puush.py

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.

Installation

Simply install it with pip, as following:

pip install puush.py

Documentation

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.

puush.Account(api_key_or_email[, password=None])

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("name@example.com", "bestpassword")

If the API key or credentials are invalid, a puush.AuthenticationError (which subclasses puush.PuushError) will be raised.

puush.Account.upload(self, f)

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.

puush.Account.delete(self, id)

Delete the file with the ID id from the Puush account.

Also consider using puush.File.delete if you already have a File.

puush.Account.thumbnail(self, id)

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.

puush.Account.history(self)

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.Account.is_premium

True if the account has premium status, False if not.


puush.File(id, url, filename, upload_time, views)

A file uploaded to Puush. Not meant to be initialized outside of the library.

puush.File.delete(self)

Delete the file from Puush.

puush.File.thumbnail(self)

Get the 100x100 thumbnail of the file. Return the raw PNG data.

puush.File.id

The Puush ID of the uploaded file. Is unique to the file, and can be used with puush.Account methods.

puush.File.url

The URL to access the file.

puush.File.filename

The file’s original filename.

puush.File.upload_time

The file’s upload time, formatted “YYYY-MM-DD HH:MM:SS”.

puush.File.views

How many times the file has been accessed.

Special thanks

I would like to thank blha303 for the Puush API documentation. Having it definitely saved me a lot of time reverse-engineering the desktop app.

Contact

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.

Enjoy!

Metadata

Release files for puush.py 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for puush.py 1.1.0
File Size Uploaded
puush.py-1.1.0.zip 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for puush.py 1.1.0
File Interpreter ABI Platform
puush.py-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 19.9 kB

Release files / puush.py-1.1.0.zip

Download URL puush.py-1.1.0.zip
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b8b966ed6ffd15187cc25d4e588ef2aa9fe622925220a1bd1fcb40d3c63217b9
BLAKE2b-256 checksum
How to use checksums
85457bbee333f67840b77dd6f78ac616862d01596bcb622b83603d7d0eeb6af7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / puush.py-1.1.0-py2.py3-none-any.whl

Download URL puush.py-1.1.0-py2.py3-none-any.whl
Size 8.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1dcc71fcfbd0723b33ec9e3ac4aeed93fa61ab781c49eea26b897d03cb853b10
BLAKE2b-256 checksum
How to use checksums
e13177a44e2160ad72d03843ee0527b63141b5291e3ed9db43df0f3019fed4e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page