Skip to main content
PyPI version Build Status

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 (traditional install):

pip install ptpimg_uploader

This places ptpimg_uploader on your PATH — run it directly afterwards:

ptpimg_uploader image.jpg

To upgrade an existing installation:

pip install --upgrade ptpimg_uploader

Using uv (no Python setup required):

Install uv from https://docs.astral.sh/uv/getting-started/installation/, then:

Install permanently and run as a regular command (same workflow as pip):

uv tool install ptpimg_uploader
ptpimg_uploader image.jpg

To upgrade:

uv tool upgrade ptpimg_uploader

Run once without installing (useful for trying it out):

uvx ptpimg_uploader image.jpg

Run the raw script directly (uv auto-installs dependencies):

uv run ptpimg_uploader.py image.jpg

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

    • With uv: uv run --with pyperclip ptpimg_uploader.py --clip image.jpg

API Key Setup

  1. Login to https://ptpimg.me

  2. Open browser developer tools (View -> Developer -> View Source in Chrome)

  3. Find api_key in the page source

  4. 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

Metadata

Release files for ptpimg-uploader 0.14

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

Source distribution (sdist)

Source distribution for ptpimg-uploader 0.14
File Size Uploaded Provenance Actions
ptpimg_uploader-0.14.tar.gz 6.9 kB With provenance Details for ptpimg_uploader-0.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ptpimg-uploader 0.14
File Interpreter ABI Platform Actions
ptpimg_uploader-0.14-py3-none-any.whl Python 3 none any Details for ptpimg_uploader-0.14-py3-none-any.whl

Total release size: 13.7 kB

Release files / ptpimg_uploader-0.14.tar.gz

Download URL ptpimg_uploader-0.14.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c946a73f604e476075d6cede35199041fc518ed107674ddd1518c3dc96c455b0
BLAKE2b-256 checksum
How to use checksums
18226439fcde1ca4bc510c109274fb154dcc232fb4d27efe3293eeecc08a857a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Release files / ptpimg_uploader-0.14-py3-none-any.whl

Download URL ptpimg_uploader-0.14-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55597889b6b6e8ed9a3854146d4978889a40752df62f79ac36094b04c4c1f914
BLAKE2b-256 checksum
How to use checksums
d22c5bc9036ca8fb155a0e83d6f2b0c6396f2cb833f30dce2b352d7a01a43cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

Security for ptpimg-uploader 0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ptpimg_uploader-0.14.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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