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 details)

Uploaded Source

File details

Details for the file multipath-0.0.2.tar.gz.

File metadata

  • Download URL: multipath-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for multipath-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0ddc7c21bdcaf62479458f33292e60518970fecfbf51167d37636f5797ab5d80
MD5 52d6670816b55eb99267ae4d3c719f6e
BLAKE2b-256 e4c3a11e1d9e5e3cfb7bf5b5454e269c3e8eb938a0c08059326e19eb3d841b5d

See more details on using hashes here.

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