All Projects → ofek → pybin

ofek / pybin

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
Cross-platform tool to put Python's user bin in PATH, no sudo/runas required!

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pybin

bootstrap4-glyphicons
How use Glyphicons with Bootstrap 4 (without getting mad)
Stars: ✭ 40 (+90.48%)
Mutual labels:  workaround
bazel rules pex
Python PEX rules for Bazel
Stars: ✭ 37 (+76.19%)
Mutual labels:  packaging
dotfiles
My collection of dotfiles
Stars: ✭ 77 (+266.67%)
Mutual labels:  scripts
Termux url opener all in one downloader
All-in-one Download Script for Termux URL Opener
Stars: ✭ 112 (+433.33%)
Mutual labels:  scripts
sdia-python
Python course material - SDIA Python
Stars: ✭ 16 (-23.81%)
Mutual labels:  packaging
mkBox
MacApp、PythonPackage、Scripts ..
Stars: ✭ 66 (+214.29%)
Mutual labels:  scripts
Scikit Build
Improved build system generator for CPython C, C++, Cython and Fortran extensions
Stars: ✭ 234 (+1014.29%)
Mutual labels:  packaging
The-Learning-Documentation-Project
This documentation is about the new learning(s) and issue(s) resolvings on different aspects of academic, professional and personal thoughts. It includes(or/with links): Research topics(& resources), Programming(issues and code), Advanced Linux commands, Networking commands, bash script command utilization, Linux packages(& scripts), Machinine l…
Stars: ✭ 27 (+28.57%)
Mutual labels:  scripts
nim-package-directory
Nim package directory - documentation builder
Stars: ✭ 47 (+123.81%)
Mutual labels:  packaging
dotfiles
I definitely don't understand the 'dot' concept
Stars: ✭ 24 (+14.29%)
Mutual labels:  scripts
PowerShellScripting
Repository for the Facebook Group PowerShell Scripting
Stars: ✭ 19 (-9.52%)
Mutual labels:  scripts
Proxmox
Proxmox Helper Scripts
Stars: ✭ 3,882 (+18385.71%)
Mutual labels:  scripts
Generative-Art
A selection of generative art scripts written in Python
Stars: ✭ 284 (+1252.38%)
Mutual labels:  scripts
pkutils
A Python packaging utility library
Stars: ✭ 19 (-9.52%)
Mutual labels:  packaging
rclone4pi
rclone4pi - Easy Install of rclone to Raspberry Pi Computer with automated folder sync demo
Stars: ✭ 91 (+333.33%)
Mutual labels:  scripts
Winepak
Flatpak-ing Microsoft Windows applications with Wine
Stars: ✭ 242 (+1052.38%)
Mutual labels:  packaging
obs-service-go modules
OBS Source Service to download, verify, and vendor Go module dependency sources
Stars: ✭ 18 (-14.29%)
Mutual labels:  packaging
craft
The universal Sentry release CLI 🚀
Stars: ✭ 117 (+457.14%)
Mutual labels:  packaging
linux-server-administration-scripts
Simple bash administration scripts for Linux to make your life easier.
Stars: ✭ 47 (+123.81%)
Mutual labels:  scripts
Wordlist404
Small but effective wordlist for brute-forcing and discovering hidden things.
Stars: ✭ 101 (+380.95%)
Mutual labels:  scripts

pybin

Latest PyPI version Supported Python versions License

When you install a package via pip install --user ..., any executables get placed in a special directory specifically for the intended user. Unfortunately, this location is most likely not included in your user's PATH variable. So for example if you did pip3 install --user hatch and then tried to learn more about your new tool by doing hatch --help, it would fail to be located. See: pypa/pip#3813

pybin solves this problem by providing a small CLI, and corresponding API, to locate your Python's user bin and optionally update the user PATH. It supports all major operating systems and does not require elevated privileges!

Fear not, this only modifies the user PATH; the system PATH is never touched nor even looked at!

Installation

pybin is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 2.6-2.7/3.3+ and PyPy.

$ pip install pybin

You may need sudo. Do NOT use --user!

Commands

Only 2!

pybin

$ pybin -h
Usage: pybin [OPTIONS] COMMAND [ARGS]...

  Shows the location of the bin directory and whether or not it is in the
  user PATH.

Options:
  -p, --pypath TEXT  An absolute path to a Python executable.
  --version          Show the version and exit.
  -h, --help         Show this message and exit.

Commands:
  put  Updates the user PATH

pybin put

$ pybin put -h
Usage: pybin put [OPTIONS]

  Updates the user PATH. The shell must be restarted for the update to take
  effect.

Options:
  -p, --pypath TEXT  An absolute path to a Python executable.
  -f, --force        Update PATH even if it appears to be correct.
  -h, --help         Show this message and exit.

API

>>> from pybin import in_path, locate, put_in_path
>>> in_path()
False
>>> locate()
'C:\\Users\\Ofek\\AppData\\Roaming\\Python\\Python36\\Scripts'
>>> success = put_in_path()

Manual modification

Use the location pybin shows in concert with this very comprehensive document Java provides: https://www.java.com/en/download/help/path.xml

License

pybin is distributed under the terms of both

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].