Skip to main content

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


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.17.tar.gz (859.6 kB view details)

Uploaded Source

Built Distribution

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

holytools-0.9.17-py3-none-any.whl (872.3 kB view details)

Uploaded Python 3

File details

Details for the file holytools-0.9.17.tar.gz.

File metadata

  • Download URL: holytools-0.9.17.tar.gz
  • Upload date:
  • Size: 859.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for holytools-0.9.17.tar.gz
Algorithm Hash digest
SHA256 b00c258ca18c24b184df2956bc43fa691c9dbaef9873f39471e738fd9f6a546a
MD5 939c71ed7462cd6dd5f9236ad6b36be4
BLAKE2b-256 6cfd82f48761259364e8612559323637523b82e46936828dcafd5403c4124ce9

See more details on using hashes here.

File details

Details for the file holytools-0.9.17-py3-none-any.whl.

File metadata

  • Download URL: holytools-0.9.17-py3-none-any.whl
  • Upload date:
  • Size: 872.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for holytools-0.9.17-py3-none-any.whl
Algorithm Hash digest
SHA256 06e9ecef289b9f72f27f7d54cdded1d5e5fd881fcc967ab0be4f03571b077dd5
MD5 e7ffa1e40257cf11326f374ad3f95866
BLAKE2b-256 61d8997c3d47331e533a6e27f68ef7b1c0a0deead00e97bfdcafb50262e7d0cf

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