PTPImg uploader, handles local files and URLs, from the commandline
Project description
Upload image file or image URL to the ptpimg.me image hosting.
Features
Upload local image files
Rehost images from image services (e.g., from imgur)
Copy resulting URL to clipboard
BBCode formatting support
Command-line and programmatic usage
Installation
Using pip (recommended):
pip install ptpimg_uploader
Using setup.py:
python setup.py install
Manual Dependencies:
- Required: requests package
Debian/Ubuntu: apt-get install python3-requests
Other systems: pip3 install requests
- Optional: pyperclip package for clipboard support
Install via: pip3 install pyperclip
API Key Setup
Login to https://ptpimg.me
Open browser developer tools (View -> Developer -> View Source in Chrome)
Find api_key in the page source
Copy the hexadecimal string (format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
Set your API key using either:
Environment variable (recommended):
# Add to your ~/.bashrc or ~/.zshenv
export PTPIMG_API_KEY=your-api-key-here
Or use the command-line option: -k / --api-key
Usage
Get help:
ptpimg_uploader -h
Upload a local image:
ptpimg_uploader ~/seed/mytorrent/folder.jpg
Rehost from URL:
ptpimg_uploader https://i.imgur.com/eaT6j3X.jpg
Multiple uploads (mix-and-match files and URLs):
ptpimg_uploader ~/seed/mytorrent/folder.jpg https://i.imgur.com/eaT6j3X.jpg
Additional command-line options
--bbcode: URLs will be wrapped in BBCode [img] tags
ptpimg_uploader --bbcode ~/seed/mytorrent/folder.jpg
--clip: Place a resulting URL to clipboard (if pyperclip package is installed)
ptpimg_uploader --clip ~/seed/mytorrent/folder.jpg
--nobell: Disable completion sound. If output is a terminal, a bell will be ringed on completion.
Programmatic Usage
The package can be used as a library via the upload function for programmatic access.
License
BSD
Acknowledgments
mjpieters - a great refactoring and Python packaging
lukacoufyl - fixing image upload order
Project details
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 ptpimg_uploader-0.13.tar.gz.
File metadata
- Download URL: ptpimg_uploader-0.13.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2bc87d0fb2b4c8d810fe0d73651db7fd14b9a14b43c88634d6f9aee21705541
|
|
| MD5 |
ae554584f13be27532067d11060d9224
|
|
| BLAKE2b-256 |
b87f2b49635706d181c300bc4098f685356ada2ff2ffed5c5420180dd3a3ca02
|
Provenance
The following attestation bundles were made for ptpimg_uploader-0.13.tar.gz:
Publisher:
pythonpublish.yml on theirix/ptpimg-uploader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ptpimg_uploader-0.13.tar.gz -
Subject digest:
b2bc87d0fb2b4c8d810fe0d73651db7fd14b9a14b43c88634d6f9aee21705541 - Sigstore transparency entry: 473308990
- Sigstore integration time:
-
Permalink:
theirix/ptpimg-uploader@83214249daba29f65953b89d9b3a0f11c2135c54 -
Branch / Tag:
refs/tags/v0.13 - Owner: https://github.com/theirix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@83214249daba29f65953b89d9b3a0f11c2135c54 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ptpimg_uploader-0.13-py3-none-any.whl.
File metadata
- Download URL: ptpimg_uploader-0.13-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d02e0fe3d73b3997e689dbad7e80df143ea00f8146ccfaab45e8b4ff126c87d
|
|
| MD5 |
7af495a413769264b559c9beed99f774
|
|
| BLAKE2b-256 |
52a4d4e76f84317f8b14ad2ff90615addf9d2058423721ac7b114ae803ccc04f
|
Provenance
The following attestation bundles were made for ptpimg_uploader-0.13-py3-none-any.whl:
Publisher:
pythonpublish.yml on theirix/ptpimg-uploader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ptpimg_uploader-0.13-py3-none-any.whl -
Subject digest:
5d02e0fe3d73b3997e689dbad7e80df143ea00f8146ccfaab45e8b4ff126c87d - Sigstore transparency entry: 473309002
- Sigstore integration time:
-
Permalink:
theirix/ptpimg-uploader@83214249daba29f65953b89d9b3a0f11c2135c54 -
Branch / Tag:
refs/tags/v0.13 - Owner: https://github.com/theirix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pythonpublish.yml@83214249daba29f65953b89d9b3a0f11c2135c54 -
Trigger Event:
release
-
Statement type: