Pathing Library
Project description
getpath
Helps with pathing in python scripts. Inspired by pathlib.
IMPORTING
from getpaths import getpath
USING CURRENT FILE PATH
current_dir = getpath() # current file's path
USER-SPECIFIED PATH
custom_dir = getpath('a','b',custom=True)
print(custom_dir)
# /a/b
ADD FILES
custom_dir/'example.txt'
# /a/b/example.txt
custom_dir.add('/a/example.txt')
# /a/b/example.txt
GO UP THE DIRECTORY
custom_dir = getpath('a','b',custom=True)
custom_dir/'..'
# /a
custom_dir.add('..')
# /a
custom_dir.up(1)
# /a
LIST EXISTING FILES AND FOLDERS
custom_dir.ls()
# /a/b/example.txt
# throws error if path does not exist
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
getpaths-0.0.31.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for getpaths-0.0.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d09eff9baf2ab0652a7e8314d482074b24ab3852202d204d2c3b531ee080cdf |
|
MD5 | c736b04d31009fa969f92f930ce8f8da |
|
BLAKE2b-256 | 3c48860fad1474616c0a5f52d5cfc013fc2f2e4639f66fff2f5a6cbd14ceea6d |