Python package for general classes and methods
Project description
🔰 generalpy
- Python package for general classes and methods
- Install using
pip install generalpy
💠 Settings
class
- Class to handle all settings related aspect for an app.
- Based on settings file stored in storage.
💠 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
💠 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
.
💠 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
💠 decorator
module
This module contains decorators
combine_single_items
: Combine item of sublists (which contain only one item) into a single sublist.conditional
: Runs the decorated function and return it's value, only if provided condition is True.run_threaded
: Runs the decorated function in a new thread.
💠 files
module
This module contains methods to work with files
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.
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
generalpy-1.3.2.tar.gz
(9.7 kB
view hashes)
Built Distribution
generalpy-1.3.2-py3-none-any.whl
(10.5 kB
view hashes)
Close
Hashes for generalpy-1.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a508b54ad193e061e9c712c7dc5e2560af152de7c7c538d776b18c633aba908a |
|
MD5 | df8d6709df551de63089ea9e62bc84b2 |
|
BLAKE2b-256 | 558e7c56d4cd31482f2c84b1b6cfacf34e9952b8a10c025675d6c3852d7ad160 |