Skip to main content

Turn-Key solution to manage paths relative to the current file

Project description

The ezpath module allows managing paths relative to the file calling the module's functions, as opposed to being relative to the current working directory. This can be helpful to manage dependencies in a large local codebase.

Example:

from ezpath import *

# adding ../src (relative to the current file) to PYTHONPATH
add_rel_path('../src', follow_links=False)

# adding an absolute path to PYTHONPATH
add_abs_path('/path/to/my/folder')

# getting the absolute path of a file/folder relative to the current file, with
# the option to go up "up" levels
get_abs_path('../src/my_file.py', up=0, follow_links=False)

# converting a path to the appropriate OS format
to_os_path('path/to/my/folder')

# find the root of a folder tree based on match patterns (the root should be named 'trunk' and contain folders named 'resources' or 'externals')
find_root('.', root_elem=['resources', 'externals'], root_name='trunk')

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

ezpath-1.7.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezpath-1.7-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file ezpath-1.7.tar.gz.

File metadata

  • Download URL: ezpath-1.7.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ezpath-1.7.tar.gz
Algorithm Hash digest
SHA256 e22440a9618ae13edbf053ff7aa6f67aa0e78309c8456c4d87402ebfe2421389
MD5 6a25568aa64263c5cd011e876e9bc3ff
BLAKE2b-256 1ddb4771dba8feccb2bedfb1a6c2a5960aa07f0fb24ecdb7c4aecd1c427cf266

See more details on using hashes here.

File details

Details for the file ezpath-1.7-py3-none-any.whl.

File metadata

  • Download URL: ezpath-1.7-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ezpath-1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c4bc27f2e00e2ca80a4c901541da0ec6f20600bab50697817462cb477e6088a5
MD5 562c43516fd0feff2034025837755466
BLAKE2b-256 a82b56b19e4ea726fc1c7ca77493f3dc6d4e5a2bf8c9a263ff16bc4368ad66bb

See more details on using hashes here.

Supported by

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