Skip to main content

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 string
  • path_obj the path represented as a pathlib.Path object

Several additional attributes are available:

  • self.type of a type enumerated by RichPathTypes
  • self.logger The value is None by default, or a Logger class object if passed at initializing
  • self.logging_en True if the RichClass initializing method is passed a Logger class object
  • self.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 result
  • self.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

richclass-1.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

richclass-1.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for richclass-1.0.1.tar.gz
Algorithm Hash digest
SHA256 43090281428bce36c9496eb229af91f5c9267702cd3935ec7255f6f6fe70a8d8
MD5 041c78dabbad9d81124a0bb7b5906041
BLAKE2b-256 bb9e17b93823decbd9ffb5d77617af3b86e151c368c51081cea61db2444e5364

See more details on using hashes here.

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

Hashes for richclass-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79f40378854a07ec124430ff893b5f2d86203c3e36378b89f5abd97176bb2e8f
MD5 6dd8525d4927d8ab92be075549aa6ea8
BLAKE2b-256 2cd6487f7163d12e76ed597ad7c047a01ccb85e9e912d42664dc621f666f2483

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