# pathnav
Navigate paths with ease for python
# Docs
## Install pathnav
`pip install pathnav`
## Create new path object
```py
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))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/titushm/pathnav",
"name": "pathnav",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "path,navigation,path edit",
"author": "TitusHM",
"author_email": "TitusHM <dev.titushm@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e5/d4/506f1d39535abc6d5d4e0bf792345f6605885f02691a82c9ab7fc6249e3d/pathnav-1.2.7.tar.gz",
"platform": null,
"description": "# pathnav\r\nNavigate paths with ease for python\r\n\r\n# Docs\r\n## Install pathnav\r\n`pip install pathnav`\r\n## Create new path object\r\n```py\r\nimport pathnav\r\n\r\npath = pathnav.path(\"C:\\\\Users\\\\titushm\\\\Repos\\\\Github\") # create a directory path object\r\n\r\n# Properties\r\nprint(path.path) # get the path as a string\r\nprint(path.dir_name) # get the name of the directory\r\nprint(path.child_dirs) # get a list of directorys in the directory\r\nprint(path.child_files) # get a list of files in the directory\r\nprint(path.dir_size) # get the size in bytes of the directory\r\nprint(path.resolved_path) # get the full path without relative parts such as .. and %enviroment_varible%\r\n\r\n# Methods\r\nprint(path.up()) # go up one directory\r\nprint(path.into(\"example-repo\")) # go down one specified directory\r\nprint(path.get_file(\"text-file.txt\")) # get a file by name in the directory, returns None if no file is present\r\nparent_path = pathnav.path(\"C:\\\\Users\\\\titushm\\\\Repos\")\r\nprint(path.is_subdir(parent_path)) # check if a path is a subdirectory of another path\r\n\r\npath = pathnav.path(\"C:\\\\Users\\\\titushm\\\\Repos\\\\Github\\\\test-file.txt\") # create a file path object\r\n\r\n# Properties\r\nprint(path.path) # get the path as a string\r\nprint(path.file_name) # get the file name as string\r\nprint(path.file_type) # get the file type as a string\r\nprint(path.parent_dir) # returns a directory path object for the directory that the file is in\r\n# Methods\r\nprint(path.is_subdir(parent_path))\r\n```\r\n",
"bugtrack_url": null,
"license": "Mozilla Public License 2.0",
"summary": "Naviagte paths with ease",
"version": "1.2.7",
"project_urls": {
"Bug Tracker": "https://github.com/titushm/pathnav/issues",
"Download": "https://github.com/titushm/pathnav/archive/refs/heads/main.zip",
"Homepage": "https://github.com/titushm/pathnav"
},
"split_keywords": [
"path",
"navigation",
"path edit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8fe31020300a6c17c8f0f819982f175cb9d0a80ae5e743dc0a8a49b83d8b6fc2",
"md5": "67dcdfdf14f317ae948fafbca6cd5f92",
"sha256": "a1bb6dba28d46743f5446c5c7253bca6a54697fc877e30934d1087dabac2aa78"
},
"downloads": -1,
"filename": "pathnav-1.2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "67dcdfdf14f317ae948fafbca6cd5f92",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 14243,
"upload_time": "2023-08-15T22:15:40",
"upload_time_iso_8601": "2023-08-15T22:15:40.346260Z",
"url": "https://files.pythonhosted.org/packages/8f/e3/1020300a6c17c8f0f819982f175cb9d0a80ae5e743dc0a8a49b83d8b6fc2/pathnav-1.2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e5d4506f1d39535abc6d5d4e0bf792345f6605885f02691a82c9ab7fc6249e3d",
"md5": "337907c4da47e893b65978346665ec59",
"sha256": "2fb613948bb2925df1d63e05602e86627907c09e8d379ec602c61ca3f97371e6"
},
"downloads": -1,
"filename": "pathnav-1.2.7.tar.gz",
"has_sig": false,
"md5_digest": "337907c4da47e893b65978346665ec59",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 8700,
"upload_time": "2023-08-15T22:15:42",
"upload_time_iso_8601": "2023-08-15T22:15:42.091183Z",
"url": "https://files.pythonhosted.org/packages/e5/d4/506f1d39535abc6d5d4e0bf792345f6605885f02691a82c9ab7fc6249e3d/pathnav-1.2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-15 22:15:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "titushm",
"github_project": "pathnav",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pathnav"
}