traveler.tools.data_download.Path#
- class traveler.tools.data_download.Path(*args, **kwargs)#
Bases:
PathBase,PurePathPurePath subclass that can make system calls.
Path represents a filesystem path but unlike PurePath, also offers methods to do system calls on path objects. Depending on your system, instantiating a Path will return either a PosixPath or a WindowsPath object. You can also instantiate a PosixPath or WindowsPath directly, but cannot instantiate a WindowsPath on a POSIX system or vice versa.
Methods#
|
Return an absolute version of this path No normalization or symlink resolution is performed. |
|
Return the string representation of the path with forward (/) slashes. |
|
Return the path as a URI. |
|
Change the permissions of the path, like os.chmod(). |
|
Return a new path pointing to the current working directory. |
|
Whether this path exists. |
Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser) |
|
|
Return a new path from the given 'file' URI. |
|
Return True if this path matches the given glob-style pattern. |
|
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. |
|
Return the group name of the file gid. |
|
Make this path a hard link pointing to the same file as target. |
|
Return a new path pointing to expanduser('~'). |
True if the path is absolute (has both a root and, if applicable, a drive). |
|
Whether this path is a block device. |
|
Whether this path is a character device. |
|
|
Whether this path is a directory. |
|
Whether this path is a FIFO. |
|
Whether this path is a regular file (also True for symlinks pointing to regular files). |
Whether this path is a junction. |
|
|
Check if this path is a mount point |
|
Return True if the path is relative to another path or False. |
Return True if the path contains one of the special names reserved by the system, if any. |
|
Whether this path is a socket. |
|
Whether this path is a symbolic link. |
|
|
Yield path objects of the directory contents. |
|
Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored). |
|
Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. |
|
Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. |
|
Return True if this path matches the given pattern. |
|
Create a new directory at this given path. |
|
Open the file pointed to by this path and return a file object, as the built-in open() function does. |
|
Return the login name of the file owner. |
Open the file in bytes mode, read it, and close the file. |
|
|
Open the file in text mode, read it, and close the file. |
|
Return the path to which the symbolic link points. |
|
Return the relative path to another path identified by the passed arguments. |
|
Rename this path to the target path. |
|
Rename this path to the target path, overwriting if that path exists. |
|
Make the path absolute, resolving all symlinks on the way and also normalizing it. |
|
Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. |
|
Remove this directory. |
|
Return whether other_path is the same or not as this file (as returned by os.path.samefile()). |
|
Return the result of the stat() system call on this path, like os.stat() does. |
|
Make this path a symlink pointing to the target path. |
|
Create this file with the given access mode, if it doesn't exist. |
|
Remove this file or link. |
|
Walk the directory tree from this directory, similar to os.walk(). |
|
Return a new path with the file name changed. |
|
Construct a new path object from any number of path-like objects. |
|
Return a new path with the stem changed. |
|
Return a new path with the file suffix changed. |
|
Open the file in bytes mode, write to it, and close the file. |
|
Open the file in text mode, write to it, and close the file. |
Attributes#
The concatenation of the drive and root, or ''. |
|
The drive prefix (letter or UNC path), if any. |
|
The final path component, if any. |
|
The logical parent of the path. |
|
A sequence of this path's logical parents. |
|
An object providing sequence-like access to the components in the filesystem path. |
|
The root of the path, if any. |
|
The final path component, minus its last suffix. |
|
The final component's last suffix, if any. |
|
A list of the final component's suffixes, if any. |