Skip to main content

Naviagte paths with ease

Project description

pathnav

Navigate paths with ease for python

Docs

Install pathnav

pip install pathnav

Create new path object

import pathnav

path = pathnav.path("C:\\Users\\titushm\\Repos\\Github") # create a directory path object

# Properties
print(path.path) # get the path as a string
print(path.dir_name) # get the name of the directory
print(path.child_dirs) # get a list of directorys in the directory
print(path.child_files) # get a list of files in the directory
print(path.dir_size) # get the size in bytes of the directory
print(path.resolved_path) # get the full path without relative parts such as .. and %enviroment_varible%

# Methods
print(path.up()) # go up one directory
print(path.into("example-repo")) # go down one specified directory
print(path.get_file("text-file.txt")) # get a file by name in the directory, returns None if no file is present
parent_path = pathnav.path("C:\\Users\\titushm\\Repos")
print(path.is_subdir(parent_path)) # check if a path is a subdirectory of another path

path = pathnav.path("C:\\Users\\titushm\\Repos\\Github\\test-file.txt") # create a file path object

# Properties
print(path.path) # get the path as a string
print(path.file_name) # get the file name as string
print(path.file_type) # get the file type as a string
print(path.parent_dir) # returns a directory path object for the directory that the file is in
# Methods
print(path.is_subdir(parent_path))

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

pathnav-1.2.7.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

pathnav-1.2.7-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file pathnav-1.2.7.tar.gz.

File metadata

  • Download URL: pathnav-1.2.7.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pathnav-1.2.7.tar.gz
Algorithm Hash digest
SHA256 2fb613948bb2925df1d63e05602e86627907c09e8d379ec602c61ca3f97371e6
MD5 337907c4da47e893b65978346665ec59
BLAKE2b-256 e5d4506f1d39535abc6d5d4e0bf792345f6605885f02691a82c9ab7fc6249e3d

See more details on using hashes here.

File details

Details for the file pathnav-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: pathnav-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pathnav-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a1bb6dba28d46743f5446c5c7253bca6a54697fc877e30934d1087dabac2aa78
MD5 67dcdfdf14f317ae948fafbca6cd5f92
BLAKE2b-256 8fe31020300a6c17c8f0f819982f175cb9d0a80ae5e743dc0a8a49b83d8b6fc2

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