ptpimg-uploader


Nameptpimg-uploader JSON
Version 0.9 PyPI version JSON
download
home_pagehttps://github.com/theirix/ptpimg-uploader
SummaryPTPImg uploader, handles local files and URLs, from the commandline
upload_time2023-06-09 19:54:59
maintainer
docs_urlNone
authortheirix
requires_python>=3.3
licenseBSD
keywords image uploader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============
ptpimg_uploader
===============

|PyPI version| |Build Status| 

Upload image file or image URL to the ptpimg.me image hosting.


Installation
------------

Using pip:

.. code-block:: bash

    pip install ptpimg_uploader


Using setup.py:

.. code-block:: bash

    python setup.py install


Manually:

  * Install python3 package ``requests`` (usually ``apt-get install python3-requests`` or ``pip3 install requests``).

  * If you want clipboard support, install ``pyperclip`` too.


API key
-------

To find your PTPImg API key, login to https://ptpimg.me, open the page source
(i.e. "View->Developer->View source" menu in Chrome), find the string api_key
and copy the hexademical string from the value attribute. Your API key should
look like 43fe0fee-f935-4084-8a38-3e632b0be68c.

You can export your ptpimg.me API key (usually in .bashrc or .zshenv) using:

.. code-block:: bash

    export PTPIMG_API_KEY=<your hex key>


or use the ``-k`` / ``--api-key`` command-line switch.

How to use
----------

Run

.. code-block:: bash

    ptpimg_uploader -h


to get command-line help.

To upload an image file:

.. code-block:: bash

    ptpimg_uploader ~/seed/mytorrent/folder.jpg


To rehost an imgur image:

.. code-block:: bash

    ptpimg_uploader https://i.imgur.com/eaT6j3X.jpg


An uploaded URL will be printed to the console.

If ``--bbcode`` parameter is specified, URLS will be wrapped in BBCode ``[img]`` tags:

.. code-block:: bash

    ptpimg_uploader --bbcode ~/seed/mytorrent/folder.jpg


If pyperclip python package is installed, the URL will be additionally copied to the clipboard.
Additionally, you can upload an URL from the clipboard:

.. code-block:: bash

    ptpimg_uploader --clip

If output is a terminal, a bell will be ringed on completion (can be disabled with a ``--nobell`` parameter).

You can specify multiple files and URLs on the command line:

.. code-block:: bash

    ptpimg_uploader ~/seed/mytorrent/folder.jpg https://i.imgur.com/eaT6j3X.jpg


The resulting URLs are printed each on separate line, and copied to your
clipboard with newlines in between.

License
-------

BSD

Acknowledgments
---------------

* mjpieters - a great refactoring and Python packaging
* lukacoufyl - fixing image upload order

.. |Build Status| image:: https://github.com/theirix/ptpimg-uploader/workflows/Upload%20Python%20Package/badge.svg
   :target: https://github.com/theirix/ptpimg-uploader/actions
.. |PyPI version| image:: https://img.shields.io/pypi/v/ptpimg-uploader.svg
   :target: https://pypi.python.org/pypi/ptpimg-uploader

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/theirix/ptpimg-uploader",
    "name": "ptpimg-uploader",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.3",
    "maintainer_email": "",
    "keywords": "image uploader",
    "author": "theirix",
    "author_email": "theirix@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/77/d7/f236d2ad814579e713171b0f55a781df50530b53fcfb930296985c8a6bfe/ptpimg_uploader-0.9.tar.gz",
    "platform": null,
    "description": "===============\nptpimg_uploader\n===============\n\n|PyPI version| |Build Status| \n\nUpload image file or image URL to the ptpimg.me image hosting.\n\n\nInstallation\n------------\n\nUsing pip:\n\n.. code-block:: bash\n\n    pip install ptpimg_uploader\n\n\nUsing setup.py:\n\n.. code-block:: bash\n\n    python setup.py install\n\n\nManually:\n\n  * Install python3 package ``requests`` (usually ``apt-get install python3-requests`` or ``pip3 install requests``).\n\n  * If you want clipboard support, install ``pyperclip`` too.\n\n\nAPI key\n-------\n\nTo find your PTPImg API key, login to https://ptpimg.me, open the page source\n(i.e. \"View->Developer->View source\" menu in Chrome), find the string api_key\nand copy the hexademical string from the value attribute. Your API key should\nlook like 43fe0fee-f935-4084-8a38-3e632b0be68c.\n\nYou can export your ptpimg.me API key (usually in .bashrc or .zshenv) using:\n\n.. code-block:: bash\n\n    export PTPIMG_API_KEY=<your hex key>\n\n\nor use the ``-k`` / ``--api-key`` command-line switch.\n\nHow to use\n----------\n\nRun\n\n.. code-block:: bash\n\n    ptpimg_uploader -h\n\n\nto get command-line help.\n\nTo upload an image file:\n\n.. code-block:: bash\n\n    ptpimg_uploader ~/seed/mytorrent/folder.jpg\n\n\nTo rehost an imgur image:\n\n.. code-block:: bash\n\n    ptpimg_uploader https://i.imgur.com/eaT6j3X.jpg\n\n\nAn uploaded URL will be printed to the console.\n\nIf ``--bbcode`` parameter is specified, URLS will be wrapped in BBCode ``[img]`` tags:\n\n.. code-block:: bash\n\n    ptpimg_uploader --bbcode ~/seed/mytorrent/folder.jpg\n\n\nIf pyperclip python package is installed, the URL will be additionally copied to the clipboard.\nAdditionally, you can upload an URL from the clipboard:\n\n.. code-block:: bash\n\n    ptpimg_uploader --clip\n\nIf output is a terminal, a bell will be ringed on completion (can be disabled with a ``--nobell`` parameter).\n\nYou can specify multiple files and URLs on the command line:\n\n.. code-block:: bash\n\n    ptpimg_uploader ~/seed/mytorrent/folder.jpg https://i.imgur.com/eaT6j3X.jpg\n\n\nThe resulting URLs are printed each on separate line, and copied to your\nclipboard with newlines in between.\n\nLicense\n-------\n\nBSD\n\nAcknowledgments\n---------------\n\n* mjpieters - a great refactoring and Python packaging\n* lukacoufyl - fixing image upload order\n\n.. |Build Status| image:: https://github.com/theirix/ptpimg-uploader/workflows/Upload%20Python%20Package/badge.svg\n   :target: https://github.com/theirix/ptpimg-uploader/actions\n.. |PyPI version| image:: https://img.shields.io/pypi/v/ptpimg-uploader.svg\n   :target: https://pypi.python.org/pypi/ptpimg-uploader\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "PTPImg uploader, handles local files and URLs, from the commandline",
    "version": "0.9",
    "project_urls": {
        "Homepage": "https://github.com/theirix/ptpimg-uploader"
    },
    "split_keywords": [
        "image",
        "uploader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c33e3e397707bc9dde2f6e405ce6064daa4e0e9ef6aa0de1c293195b3c8471ed",
                "md5": "4723f20fbb4a6a655485eeea38f19027",
                "sha256": "56044f206e8059bd18da0f0197c0e4735b2106964bd126cdf720cb74de849ac2"
            },
            "downloads": -1,
            "filename": "ptpimg_uploader-0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4723f20fbb4a6a655485eeea38f19027",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.3",
            "size": 5775,
            "upload_time": "2023-06-09T19:54:58",
            "upload_time_iso_8601": "2023-06-09T19:54:58.147084Z",
            "url": "https://files.pythonhosted.org/packages/c3/3e/3e397707bc9dde2f6e405ce6064daa4e0e9ef6aa0de1c293195b3c8471ed/ptpimg_uploader-0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77d7f236d2ad814579e713171b0f55a781df50530b53fcfb930296985c8a6bfe",
                "md5": "e034d260039f739945e229a79d86b949",
                "sha256": "2e7dbf55a2e68a2a0a1817a24a8ebf6ac0c500e575cb6b11a5fe27c03cee72b5"
            },
            "downloads": -1,
            "filename": "ptpimg_uploader-0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "e034d260039f739945e229a79d86b949",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.3",
            "size": 5276,
            "upload_time": "2023-06-09T19:54:59",
            "upload_time_iso_8601": "2023-06-09T19:54:59.440588Z",
            "url": "https://files.pythonhosted.org/packages/77/d7/f236d2ad814579e713171b0f55a781df50530b53fcfb930296985c8a6bfe/ptpimg_uploader-0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-09 19:54:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "theirix",
    "github_project": "ptpimg-uploader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ptpimg-uploader"
}
        
Elapsed time: 0.14963s