Skip to main content

A miniscule python package for joining and resolving paths against multiple possible directories.A python package for resolving relative paths against multiple root directories

Project description

A miniscule python package for joining and resolving paths against multiple possible directories.

[documentation]

Installation

To install use pip:

$ pip install multipath

Or clone the repo:

$ git clone https://github.com/adamkewley/multipath.git $ python setup.py install

Example Usage

import multipath

paths = [
    "./",
    "~/.someapp/",
    "etc/someapp/",
]

# returns:
#   './config.yml` if it exists; or,
#   '~/.someapp/config.yml` if it exists; or,
#   'etc/someapp/config.yml` if it exists; or,
#   raises FileNotFoundError
config = multipath.resolve(paths, "config.yml")

Project details


Download files

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

Source Distribution

multipath-0.0.2.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page