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
None None None NoneRelease 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.35.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for getpaths-0.0.35-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eae66a9bc657e88c5da75cd9b497c61c0343c7465e82d3b80ffd6372e03df07 |
|
MD5 | 99096e850d17e65f73121ecd8e17fd74 |
|
BLAKE2b-256 | aa86db8bebc4d4ee7e101ecea5e20daf9a7f3461e469eea1e90a6437cf7af36c |