Metadata-Version: 2.5
Name: pypathutil
Version: 0.0.18
Summary: command line utilities to help you work with paths
Project-URL: Homepage, https://github.com/veltzer/pypathutil
Project-URL: Bug Tracker, https://github.com/veltzer/pypathutil/issues
Project-URL: Documentation, https://veltzer.github.io/pypathutil
Project-URL: Download, https://pypi.org/project/pypathutil/
Project-URL: Repository, https://github.com/veltzer/pypathutil
Author-email: Mark Veltzer <mark.veltzer@gmail.com>
Maintainer-email: Mark Veltzer <mark.veltzer@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: append,command-line,path,reduce,remove,shell
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Utilities
Requires-Python: >=3.14
Requires-Dist: pylogconf
Requires-Dist: pytconf
Description-Content-Type: text/markdown

<!-- This file is generated. Do not edit it by hand: your changes will be
     lost on the next build. Edit the template it is rendered from, or the
     values that template reads, and build again. -->
# *pypathutil* project by Mark Veltzer

description: command line utilities to help you work with paths

project website: <https://veltzer.github.io/pypathutil>

author: Mark Veltzer

version: 0.0.18

## github

![License](https://img.shields.io/github/license/veltzer/pypathutil)

## build

![build](https://github.com/veltzer/pypathutil/workflows/build/badge.svg)

## pypi

![PyPI - Status](https://img.shields.io/pypi/status/pypathutil)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pypathutil)
![PyPI - License](https://img.shields.io/pypi/l/pypathutil)
![PyPI - Package Name](https://img.shields.io/pypi/v/pypathutil)
![PyPI - Format](https://img.shields.io/pypi/format/pypathutil)

## pypi download

![PyPI - Downloads](https://img.shields.io/pypi/dd/pypathutil)
![PyPI - Downloads](https://img.shields.io/pypi/dw/pypathutil)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pypathutil)

## What is it for ?

have you even done calculations of paths in shells of the form:

    $ export PATH=$PATH:$HOME/bin

And did you get upset when the path came out wrong? either repeated
elements, extra colons, wrong order and the like?

This is the end of your troubles.

## Examples

    $ export PATH=$(pypathutil add $PATH /usr/games/bin)

This is the same as adding:

    $ export PATH=$(pypathutil add --head $PATH /usr/games/bin)

Which means adding to the head of the path.

If you want to add to the tail of the path just use:

    $ export PATH=$(pypathutil add --tail $PATH /usr/games/bin)

If you are on windows and want a different separator

    $ export PATH=$(pypathutil add --separator \; $PATH /usr/games/bin)

But default pypathutil will remove duplicate entries,
remove non absolute paths, and remove folders which do not exist.
All of these can be controlled with appropriate flags.

## Installing

    $ pip3 install pypathutil --user

to install in your home directory or

    $ sudo -H pip3 install pypathutil

to install for all users on the system.

If you don't have pip3 then you can probably get it using:

    $ sudo apt install python3-pip

## Performance

After doing a little performance work it dawned on me that writing bash
code to do the same will be much faster. And I actually wrote bash
functions to implement all of this but this package is still my best
suggestion for people who want a solid foundation (bash can not be
called solid).

## Using pypathutil API

You can, of course, use pypathutil for it's API as a python module.
It's quite intuitive.

## contact me

[mark.veltzer@gmail.com](mailto:mark.veltzer@gmail.com)

Mark Veltzer, Copyright © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026
