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_strthe path represented as a stringpath_objthe path represented as a pathlib.Path object
Several additional attributes are available:
self.typeof a type enumerated by RichPathTypesself.loggerThe value is None by default, or a Logger class object if passed at initializingself.logging_enTrue if the RichClass initializing method is passed a Logger class objectself.requiredIf true, will raise a FileNotFoundError exception on failed self.detect()
Several methods are available for a class instance of RichPath:
self.detectsearches for the existence of the directory or file specified in the RichPath object and returns bool resultself.update_path_strallows 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_objallows 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file richclass-1.0.1.tar.gz.
File metadata
- Download URL: richclass-1.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43090281428bce36c9496eb229af91f5c9267702cd3935ec7255f6f6fe70a8d8
|
|
| MD5 |
041c78dabbad9d81124a0bb7b5906041
|
|
| BLAKE2b-256 |
bb9e17b93823decbd9ffb5d77617af3b86e151c368c51081cea61db2444e5364
|
File details
Details for the file richclass-1.0.1-py3-none-any.whl.
File metadata
- Download URL: richclass-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79f40378854a07ec124430ff893b5f2d86203c3e36378b89f5abd97176bb2e8f
|
|
| MD5 |
6dd8525d4927d8ab92be075549aa6ea8
|
|
| BLAKE2b-256 |
2cd6487f7163d12e76ed597ad7c047a01ccb85e9e912d42664dc621f666f2483
|