Collection of very general python utilities
Project description
Holytools
A collection of general utilities in various very general areas that aim for simplicity in use. Functionalities include:
- object serialization -> holytools.abstract.serialization
- fileIO and mock files -> holytools.file
- configuration management -> holytools.configs
- file system navigation and management -> holytools.fsys
- task/event scheduling -> holytools.events
- hardware interaction -> holytools.hardware
- web search/scraping -> holytools.web
- command line interfaces -> holytools.userIO
Setup
Latest release from PyPI:
pip install holytools
OR: Most recent commit from github:
pip install holytools @ git+https://git@github.com/Somerandomguy10111/holytools.git
Examples
- holytools.fsys -> Zip a file or folder or get resource information
# fsys
from holytools.fsys import FsysNode
node = FsysNode(path='/home/daniel/Drive/Desktop/fluent_python.pdf')
zip_bytes = node.get_zip()
last_modified : float = node.get_epochtime_last_modified()
file_size_mb : float = node.get_size_in_MB()
- holytools.config -> set/get configs from a config file or from unix password manager "pass"
# config
from holytools.configs import FileConfigs, PassConfigs
configs = FileConfigs(config_fpath='~/myconfigs.ini')
key = 'plot_images'
configs.set(key=key, value=False)
plot_images : bool = configs.get(key=key) # False
pass_configs = PassConfigs()
secret_key = pass_configs.get(key='secret_key')
- holytools.abstract -> Save/load
# serialization
from holytools.abstract import Picklable
class SomeClass(Picklable):
def __init__(self, s : str, x : float):
import uuid
self.s = s
self.x = x
self.uuid = uuid.uuid4()
obj = SomeClass(s='hello there', x =2.3)
serialized_obj = obj.to_str()
loaded_obj = SomeClass.from_str(s=serialized_obj)
print(obj.__dict__) # {'s': 'hello there', 'x': 2.3, 'uuid': UUID('79b489be-3871-4da0-ade4-665097b9bf42')}
print(loaded_obj.__dict__) # {'s': 'hello there', 'x': 2.3, 'uuid': UUID('79b489be-3871-4da0-ade4-665097b9bf42')}
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
holytools-0.9.13.tar.gz
(858.9 kB
view details)
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
holytools-0.9.13-py3-none-any.whl
(872.0 kB
view details)
File details
Details for the file holytools-0.9.13.tar.gz.
File metadata
- Download URL: holytools-0.9.13.tar.gz
- Upload date:
- Size: 858.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd7cceef24ab02fd15d352c1c34391870a89e2d67492e58c422f8b653bf0e426
|
|
| MD5 |
932aeb76f69729e4aee84ff3809bfd13
|
|
| BLAKE2b-256 |
3be2d44c4da516cb1aed6b371befb10d4163c18bd8e438039a15b4879360ba4e
|
File details
Details for the file holytools-0.9.13-py3-none-any.whl.
File metadata
- Download URL: holytools-0.9.13-py3-none-any.whl
- Upload date:
- Size: 872.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
378b9aa4e14a429b11cec9d4d5de1d7a84c79f33f64da9bc8935645bea09368d
|
|
| MD5 |
2d6acdf5638a8165070277933d6cdd19
|
|
| BLAKE2b-256 |
7c8655f4a85992af4bb62e478e9a670ce19a2e4bd0cb6589c876bd0aece096dc
|