1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
# userpath
| | |
| --- | --- |
| CI/CD | [](https://github.com/ofek/userpath/actions/workflows/test.yml) [](https://github.com/ofek/userpath/actions/workflows/build.yml) |
| Package | [](https://pypi.org/project/userpath/) [](https://pypi.org/project/userpath/) |
| Meta | [](https://spdx.org/licenses/) [](https://github.com/sponsors/ofek) |
-----
This is a tool for modifying a user's `PATH`.
**Table of Contents**
- [Installation](#installation)
- [CLI](#cli)
- [API](#api)
- [License](#license)
## Installation
```console
pip install userpath
```
## CLI
```console
$ userpath -h
Usage: userpath [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
append Appends to the user PATH
prepend Prepends to the user PATH
verify Checks if locations are in the user PATH
```
## API
```pycon
>>> import userpath
>>> location = r'C:\Users\Ofek\Desktop\test'
>>>
>>> userpath.in_current_path(location)
False
>>> userpath.in_new_path(location)
False
>>> userpath.append(location)
True
>>> userpath.in_new_path(location)
True
>>> userpath.need_shell_restart(location)
True
```
## License
`userpath` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|