A collection of feature rich classes
Project description
A collection of feature rich classes
RichClass is a collection of python classes that aim to rapidly bridge the gap between verbose code and creating feature rich objects with common sense features. The flagship class for this package's release being RichPath
, a class that builds on the pathlib.Path
class but adds several quality of life tools such as the method detect()
which returns True if the directory or file exists. RichPath
also maintains an attribute present
which maintains the memory of the result of detect()
and is updated when that method is called.
Classes
RichPath
RichPath
is a rich developed class
This class simultaneously maintains both attributes:
path_str
the path represented as a stringpath_obj
the path represented as a pathlib.Path object
Several additional attributes are available:
self.type
of a type enumerated by RichPathTypesself.logger
The value is None by default, or a Logger class object if passed at initializingself.logging_en
True if the RichClass initializing method is passed a Logger class objectself.required
If true, will raise a FileNotFoundError exception on failed self.detect()
Several methods are available for a class instance of RichPath:
self.detect
searches for the existence of the directory or file specified in the RichPath object and returns bool resultself.update_path_str
allows you to update the path of the RichPath object with a directory or file string- Calls self.detect() and returns bool result
self.update_path_obj
allows you to update the path of the RichPath object with a pathlib.Path class object- Calls self.detect() and returns bool result
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
Built Distribution
Hashes for richclass-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79f40378854a07ec124430ff893b5f2d86203c3e36378b89f5abd97176bb2e8f |
|
MD5 | 6dd8525d4927d8ab92be075549aa6ea8 |
|
BLAKE2b-256 | 2cd6487f7163d12e76ed597ad7c047a01ccb85e9e912d42664dc621f666f2483 |