Metadata-Version: 2.1
Name: generalpy
Version: 1.7.0
Summary: Python package for general classes and methods
Project-URL: Homepage, https://github.com/sayyid5416/generalpy
Project-URL: Bug Tracker, https://github.com/sayyid5416/generalpy/issues
Author: sayyid5416
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: pytz
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://github.com/sayyid5416/generalpy/actions/workflows/publish.yml"><img src="https://github.com/sayyid5416/generalpy/actions/workflows/publish.yml/badge.svg"></a>
  <a href="https://pypi.org/project/generalpy"><img alt="PyPI" src="https://img.shields.io/pypi/v/generalpy?label=PyPI%20Package%20Version&logo=pypi&logoColor=white&style=plastic"></a>
</p>

### 🔰 generalpy
- Python package for general classes and methods
- Install using `pip install generalpy`


---


### 💠 `Attrib` class _(windows OS only)_
  - Handles the `attrib` command from windows OS.
  - To set/modify/remove the `A/H/I/R/S` attributes for files/folders.
  - Use `attrib /?` in CMD for more info.


### 💠 `CustomLogging` class
  - Class to handle logging in easy way.
  - All logging class features + more.
  - Compact & Full formatting are applied wherever applicable.
  - Stream logging to Terminal.
  - File logging: For all logs, and error logs in different files.
  - You can also set different time zone for `%(asctime)s`.


### 💠 `ICACLS` class _(windows OS only)_
  - Handles functions related to `icacls` command from windows OS.
  - To set/modify/remove the permissions for files/folders.
  - Use `icacls /?` in CMD for more info.


### 💠 `IgnoreError(Exception)` class
  - This exception should be ignored after catching it for the sake of continuity.
  - You can ignore it in `try: ... except IgnoreError: pass` block, or
  - By logging/printing to console.


### 💠 `LevelFormatter` class
  - Custom `logging.Formatter` class.
  - To set formatting based on logging Levels. Like `logging.INFO`, `logging.ERROR` etc.
  - You can also set different time zone for `%(asctime)s`


### 💠 `Settings` class
  - Handles all settings related aspect for an app.
  - Based on settings file stored in storage.


### 💠 `TaskList` class _(windows OS only)_
  - Handles functions related to `tasklist` command of windows OS.
  - Get running tasks/executables.
  - Check if an exe is running or not, or how many of it's instances are running.


---


### 💠 `decorator` module
  This module contains decorators
  - `combine_single_items`: Combine item of sublists _(which contain only one item)_ into a single sublist.
  - `conditional`: Run decorated function and return it's value, only if provided condition is True.
  - `platform_specific`: Run decorated function only if current platform is one of the `supportedPlatforms`
  - `run_threaded`: Run decorated function in a new thread.
  - `time_it`: Prints the time taken by decorated function.


### 💠 `files` module
  This module contains methods to work with files
  - `delete_files_by_condition`: Deletes all files in directory and its subdirectories according to some condition.
  - `delete_files_by_prefix_suffix`: Deletes all files in directory and its subdirectories according to prefix/suffix in their name.
  - `get_new_path`: Returns new filePath for files _(which do not exist)_ by appending (1/2/3/..).
  - `get_random_file_path`: Returns a random path of a file _(which do not exist)_ in parentDirectory.
  - `read_file_chunks`: Read file and returns possible data chunk by chunk.


### 💠 `general` module
  This module contains general methods
  - `generate_repr_str`: Returns a suitable string for `__repr__` method of classes.
  - `get_digit_from_text`: Returns the digit from the first occurrence of `(digit)`.
  - `is_python`: Returns `True` if current running app is `python`.
  - `set_app_user_model_id`: Sets the App User Model ID for the current process on windows OS.