pickley


Namepickley JSON
Version 4.5.6 PyPI version JSON
download
home_pagehttps://github.com/codrsquad/pickley
SummaryAutomate installation of standalone python CLIs
upload_time2025-01-22 03:57:35
maintainerNone
docs_urlNone
authorZoran Simic
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements click runez
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Automate installation of standalone python CLIs
===============================================

.. image:: https://img.shields.io/pypi/v/pickley.svg
    :target: https://pypi.org/project/pickley/
    :alt: Version on pypi

.. image:: https://github.com/codrsquad/pickley/workflows/Tests/badge.svg
    :target: https://github.com/codrsquad/pickley/actions
    :alt: Tested with Github Actions

.. image:: https://codecov.io/gh/codrsquad/pickley/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/codrsquad/pickley
    :alt: Test code codecov

.. image:: https://img.shields.io/pypi/pyversions/pickley.svg
    :target: https://github.com/codrsquad/pickley
    :alt: Python versions tested (link to github project)


Overview
========

**pickley** allows to install and keep up-to-date standalone pip-installable python CLIs
such as tox_, hatch_, etc.

It is `similar to pipx`_, main difference being installed CLIs automatically self-upgrade
as you use them.

It can work out of the box, **without any configuration**:

- **pickley** is portable, it will run and install other CLIs in the same folder it's running from
  (drop it in ``~/.local/bin`` or ``/usr/local/bin`` for example)

- All pypi packages with ``console_scripts`` entry point(s) can be immediately installed

- Latest non-prerelease pypi version will be installed by default

- Any specification acceptable to ``pip install`` can be stated, for example::

    pickley install tox  # track latest version

    pickley install 'tox>0a0'  # track pre-releases as well

    pickley install 'tox<4'  # track latest version that is strictly less than v4

    pickley install tox==3.24.3  # pin to a specific version

    pickley install tox~=3.28  # track version range

    pickley install git+https://...@some-branch  # track a git branch


With **some configuration**, the following becomes possible:

- You can pin what version to install, what python to use etc, per pypi package

- You can define ``bundle``-s: names that install several pypi packages at once,
  for example: you could define a ``bundle:dev`` to install ``tox pipenv pre-commit``

- You can use a custom pypi server index (pip's default is respected by default)

- You can use the **symlink** delivery method, which will use symlinks instead of self-upgrading wrapper


Example
=======

Once you have ``pickley``, you can get other python CLIs and use them as standalone programs, for example::

    # One-liner to grab pickley, and drop it in ~/.local/bin
    $ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 -

    # Double-check you do have ~/.local/bin in your PATH
    $ which -a pickley
    ~/.local/bin/pickley

    $ pickley base
    ~/.local/bin

    $ pickley install install tox 'hatch<2'
    Installed tox v4.21.2 in 1 second 4 ms
    Installed hatch v1.12.0 in 1 second 791 ms

    $ which tox
    ~/.local/bin/tox

    $ tox --version
    4.21.2 from .../.pk/tox-4.21.2/...

    $ pickley list
    | Package | Version | PM | Python           |
    ----------|---------|----|-------------------
    | hatch   | 1.12.0  | uv | /usr/bin/python3 |
    | tox     | 4.21.2  | uv | /usr/bin/python3 |
    | uv      | 0.4.20  | uv | /usr/bin/python3 |

    $ pickley list -v
    | Package | Version | PM | Python           | Delivery | Track   |
    ----------|---------|----|------------------|----------|----------
    | hatch   | 1.12.0  | uv | /usr/bin/python3 | wrap     | hatch<2 |
    | tox     | 4.21.2  | uv | /usr/bin/python3 | wrap     | tox     |
    | uv      | 0.4.20  | uv | /usr/bin/python3 | wrap     | uv      |


Configuration
=============

See config_


Features
========

- Any pypi_ package that has ``console_scripts`` entry point can be installed and kept up-to-date

- Aims to work with zero configuration (but configuration is possible):

    - entirely portable, installations are performed in the same folder where **pickley** resides,
      drop it in ``~/.local/bin`` and all the stuff you install with it will also be there

    - latest non pre-release version from pypi is used

Commands
========

    - ``install``: Install specified package(s)

    - ``uninstall``: Uninstall specified package(s)

    - ``upgrade``: Upgrade specified package(s)

    - ``check``: Exit with code 0 if specified package(s) are up-to-date

    - ``list``: List installed packages via **pickley**, in folder where it resides (not globally)

    - ``base``: Print the base folder where **pickley** resides

    - ``config``: Show current configuration

    - ``describe``: Describe a package spec (version and entrypoints)

    - ``diagnostics``: Show diagnostics info

    - ``run``: Run a python CLI (auto-install it if needed)

    - ``bootstrap``: Install pickley itself in target base folder


Installation
============

Install latest version in `~/.local/bin`
----------------------------------------

If you have uv_, you can use it to bootstrap **pickley**, for example in ``~/.local/bin``::

    $ uvx pickley bootstrap ~/.local/bin


Handy one-line using ``bash``::

    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/get-pickley)"


Handy one-liner using python (see ``--help``, the script accepts a few options)::

    $ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 - --help


If you happen to have uv_ already installed (anywhere), you can run::

    $ uvx pickley bootstrap ~/.local/bin


Install from source
-------------------

Run (you will need tox_)::

    git clone https://github.com/codrsquad/pickley.git
    cd pickley
    uv venv
    uv pip install -r requirements.txt -r tests/requirements.txt -e .
    .venv/bin/pickley --help


.. _pypi: https://pypi.org/

.. _tox: https://pypi.org/project/tox/

.. _hatch: https://pypi.org/project/hatch/

.. _config: https://github.com/codrsquad/pickley/wiki/Config

.. _similar to pipx: https://github.com/codrsquad/pickley/wiki/Pickley-vs-pipx

.. _uv: https://pypi.org/project/uv/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/codrsquad/pickley",
    "name": "pickley",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Zoran Simic",
    "author_email": "zoran@simicweb.com",
    "download_url": "https://files.pythonhosted.org/packages/33/9c/52cdb4b67c34b3c6873c744c9354e3242c57d509db62fd0ebf0fb87fbb58/pickley-4.5.6.tar.gz",
    "platform": null,
    "description": "Automate installation of standalone python CLIs\n===============================================\n\n.. image:: https://img.shields.io/pypi/v/pickley.svg\n    :target: https://pypi.org/project/pickley/\n    :alt: Version on pypi\n\n.. image:: https://github.com/codrsquad/pickley/workflows/Tests/badge.svg\n    :target: https://github.com/codrsquad/pickley/actions\n    :alt: Tested with Github Actions\n\n.. image:: https://codecov.io/gh/codrsquad/pickley/branch/main/graph/badge.svg\n    :target: https://codecov.io/gh/codrsquad/pickley\n    :alt: Test code codecov\n\n.. image:: https://img.shields.io/pypi/pyversions/pickley.svg\n    :target: https://github.com/codrsquad/pickley\n    :alt: Python versions tested (link to github project)\n\n\nOverview\n========\n\n**pickley** allows to install and keep up-to-date standalone pip-installable python CLIs\nsuch as tox_, hatch_, etc.\n\nIt is `similar to pipx`_, main difference being installed CLIs automatically self-upgrade\nas you use them.\n\nIt can work out of the box, **without any configuration**:\n\n- **pickley** is portable, it will run and install other CLIs in the same folder it's running from\n  (drop it in ``~/.local/bin`` or ``/usr/local/bin`` for example)\n\n- All pypi packages with ``console_scripts`` entry point(s) can be immediately installed\n\n- Latest non-prerelease pypi version will be installed by default\n\n- Any specification acceptable to ``pip install`` can be stated, for example::\n\n    pickley install tox  # track latest version\n\n    pickley install 'tox>0a0'  # track pre-releases as well\n\n    pickley install 'tox<4'  # track latest version that is strictly less than v4\n\n    pickley install tox==3.24.3  # pin to a specific version\n\n    pickley install tox~=3.28  # track version range\n\n    pickley install git+https://...@some-branch  # track a git branch\n\n\nWith **some configuration**, the following becomes possible:\n\n- You can pin what version to install, what python to use etc, per pypi package\n\n- You can define ``bundle``-s: names that install several pypi packages at once,\n  for example: you could define a ``bundle:dev`` to install ``tox pipenv pre-commit``\n\n- You can use a custom pypi server index (pip's default is respected by default)\n\n- You can use the **symlink** delivery method, which will use symlinks instead of self-upgrading wrapper\n\n\nExample\n=======\n\nOnce you have ``pickley``, you can get other python CLIs and use them as standalone programs, for example::\n\n    # One-liner to grab pickley, and drop it in ~/.local/bin\n    $ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 -\n\n    # Double-check you do have ~/.local/bin in your PATH\n    $ which -a pickley\n    ~/.local/bin/pickley\n\n    $ pickley base\n    ~/.local/bin\n\n    $ pickley install install tox 'hatch<2'\n    Installed tox v4.21.2 in 1 second 4 ms\n    Installed hatch v1.12.0 in 1 second 791 ms\n\n    $ which tox\n    ~/.local/bin/tox\n\n    $ tox --version\n    4.21.2 from .../.pk/tox-4.21.2/...\n\n    $ pickley list\n    | Package | Version | PM | Python           |\n    ----------|---------|----|-------------------\n    | hatch   | 1.12.0  | uv | /usr/bin/python3 |\n    | tox     | 4.21.2  | uv | /usr/bin/python3 |\n    | uv      | 0.4.20  | uv | /usr/bin/python3 |\n\n    $ pickley list -v\n    | Package | Version | PM | Python           | Delivery | Track   |\n    ----------|---------|----|------------------|----------|----------\n    | hatch   | 1.12.0  | uv | /usr/bin/python3 | wrap     | hatch<2 |\n    | tox     | 4.21.2  | uv | /usr/bin/python3 | wrap     | tox     |\n    | uv      | 0.4.20  | uv | /usr/bin/python3 | wrap     | uv      |\n\n\nConfiguration\n=============\n\nSee config_\n\n\nFeatures\n========\n\n- Any pypi_ package that has ``console_scripts`` entry point can be installed and kept up-to-date\n\n- Aims to work with zero configuration (but configuration is possible):\n\n    - entirely portable, installations are performed in the same folder where **pickley** resides,\n      drop it in ``~/.local/bin`` and all the stuff you install with it will also be there\n\n    - latest non pre-release version from pypi is used\n\nCommands\n========\n\n    - ``install``: Install specified package(s)\n\n    - ``uninstall``: Uninstall specified package(s)\n\n    - ``upgrade``: Upgrade specified package(s)\n\n    - ``check``: Exit with code 0 if specified package(s) are up-to-date\n\n    - ``list``: List installed packages via **pickley**, in folder where it resides (not globally)\n\n    - ``base``: Print the base folder where **pickley** resides\n\n    - ``config``: Show current configuration\n\n    - ``describe``: Describe a package spec (version and entrypoints)\n\n    - ``diagnostics``: Show diagnostics info\n\n    - ``run``: Run a python CLI (auto-install it if needed)\n\n    - ``bootstrap``: Install pickley itself in target base folder\n\n\nInstallation\n============\n\nInstall latest version in `~/.local/bin`\n----------------------------------------\n\nIf you have uv_, you can use it to bootstrap **pickley**, for example in ``~/.local/bin``::\n\n    $ uvx pickley bootstrap ~/.local/bin\n\n\nHandy one-line using ``bash``::\n\n    $ /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/get-pickley)\"\n\n\nHandy one-liner using python (see ``--help``, the script accepts a few options)::\n\n    $ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 - --help\n\n\nIf you happen to have uv_ already installed (anywhere), you can run::\n\n    $ uvx pickley bootstrap ~/.local/bin\n\n\nInstall from source\n-------------------\n\nRun (you will need tox_)::\n\n    git clone https://github.com/codrsquad/pickley.git\n    cd pickley\n    uv venv\n    uv pip install -r requirements.txt -r tests/requirements.txt -e .\n    .venv/bin/pickley --help\n\n\n.. _pypi: https://pypi.org/\n\n.. _tox: https://pypi.org/project/tox/\n\n.. _hatch: https://pypi.org/project/hatch/\n\n.. _config: https://github.com/codrsquad/pickley/wiki/Config\n\n.. _similar to pipx: https://github.com/codrsquad/pickley/wiki/Pickley-vs-pipx\n\n.. _uv: https://pypi.org/project/uv/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Automate installation of standalone python CLIs",
    "version": "4.5.6",
    "project_urls": {
        "Documentation": "https://github.com/codrsquad/pickley/wiki",
        "Homepage": "https://github.com/codrsquad/pickley",
        "Release notes": "https://github.com/codrsquad/pickley/wiki/Release-notes",
        "Source": "https://github.com/codrsquad/pickley"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8c5d918da4cb7cd69660be632665a2d6d04b1f75ba47a959b0ee4f1f42cbecd",
                "md5": "5910c675a8f85b240fd407dfb4873d40",
                "sha256": "5a1006767829a5ac3ee78a94ac7086abb1c3e26335332ffff449101219514779"
            },
            "downloads": -1,
            "filename": "pickley-4.5.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5910c675a8f85b240fd407dfb4873d40",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 37854,
            "upload_time": "2025-01-22T03:57:32",
            "upload_time_iso_8601": "2025-01-22T03:57:32.633817Z",
            "url": "https://files.pythonhosted.org/packages/f8/c5/d918da4cb7cd69660be632665a2d6d04b1f75ba47a959b0ee4f1f42cbecd/pickley-4.5.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "339c52cdb4b67c34b3c6873c744c9354e3242c57d509db62fd0ebf0fb87fbb58",
                "md5": "901a2393c605eb5541d7eaa674959917",
                "sha256": "ea5cbecbd683a824004978f586ab8567425ead2c22b06211701fd2900568a594"
            },
            "downloads": -1,
            "filename": "pickley-4.5.6.tar.gz",
            "has_sig": false,
            "md5_digest": "901a2393c605eb5541d7eaa674959917",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 45648,
            "upload_time": "2025-01-22T03:57:35",
            "upload_time_iso_8601": "2025-01-22T03:57:35.072164Z",
            "url": "https://files.pythonhosted.org/packages/33/9c/52cdb4b67c34b3c6873c744c9354e3242c57d509db62fd0ebf0fb87fbb58/pickley-4.5.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-22 03:57:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "codrsquad",
    "github_project": "pickley",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": [
                [
                    "~=",
                    "8.0"
                ]
            ]
        },
        {
            "name": "runez",
            "specs": [
                [
                    "~=",
                    "5.2"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "pickley"
}
        
Elapsed time: 5.50210s