Skip to main content

path related functions

Project description


Pypi Status Python Version license maintenance

Build Status Codecov Status Better Code Maintainability snyk security

path related functions - that also work correctly with windows UNC Paths like //server/share/directory/../../directory2

100% code coverage, mypy static type checking, tested under Linux, OsX, Windows and Wine, automatic daily builds and monitoring

Try it Online

You might try it right away in Jupyter Notebook by using the “launch binder” badge, or click here

Installation and Upgrade

From source code:

# normal install
python install
# test without installing
python test

via pip latest Release:

# latest Release from pypi
pip install lib_path

# test without installing
pip install lib_path --install-option test

via pip latest Development Version:

# upgrade all dependencies regardless of version number (PREFERRED)
pip install --upgrade --upgrade-strategy eager
# normal install
pip install --upgrade
# test without installing
pip install --install-option test

via requirements.txt:

# Insert following line in Your requirements.txt:
# for the latest Release:
# for the latest Development Version :

# to install and upgrade all modules mentioned in requirements.txt:
pip install --upgrade -r /<path>/requirements.txt

via python:

# for the latest Release
python -m pip install upgrade lib_path

# for the latest Development Version
python -m pip install upgrade

Basic Usage

chdir_to_path_of_file(path: str) -> None

expand_filelist_subdirectories(l_paths: List[str], expand_subdirs: bool = True, follow_links: bool = True) -> List[str]

format_abs_norm_path(path: str) -> str

get_absolute_dirname(path: str) -> str

get_absolute_path(path: str) -> str

get_absolute_path_relative_from_path(path: str, path2: str) -> str

get_basename_without_extension(path: str) -> str

get_current_dir() -> str

get_files_and_directories_from_list_of_paths(l_paths: List[str]) -> Tuple[List[str], List[str]]

get_files_from_directory_recursive(directory: str, followlinks: bool = True) -> List[str]

is_relative_path(path: str) -> bool

is_windows_network_unc(path: str) -> bool

log_and_raise_if_directory_does_not_exist(directory: str) -> None

log_and_raise_if_file_does_not_exist(file: str) -> None

log_and_raise_if_path_does_not_exist(path: str) -> None

path_join_posix(path: str, *paths: str)

path_remove_trailing_slashes(path: str) -> str

path_starts_with_windows_drive_letter(path: str) -> bool

strip_and_replace_backslashes(path: str) -> str

substract_windows_drive_letter(path: str) -> str


following modules will be automatically installed :

pytest  # see :
typing  # see :


  • special thanks to “uncle bob” Robert C. Martin, especially for his books on “clean code” and “clean architecture”


I would love for you to fork and send me pull request for this project. - please Contribute


This software is licensed under the MIT license



2019-04-19: Initial public release, PyPi Release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lib-path, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size lib_path-1.0.0-py3-none-any.whl (7.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lib_path-1.0.0.tar.gz (6.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page