from xml.etree.ElementTree import indentfrom sys import prefix
Tools
Python Utility Tools Library
Startup Info
This module print in stdout general info at startup. Should be added at the beginning of the main program or where you need to display this information:
-
examples:
from tools.startup_info import startup_info startup_info()
result:
-------------------------- 2020-11-12 13:14:15.678901 User: DemoUser Host: DemoUser-PC OS Platform: Windows-10-10.0.19020-SP0 Python Version: 3.11.2 (tags/v3.11.2:bffe2c1, Jan 08 2020, 10:12:11) [MSC v.1936 64 bit (AMD64)] Implementation: CPython -----------------------
Common
This module contains tools for general use.
Attribute Manager
This class contains methods for managing class attributes taking in consideration real mangled name of each attribute.
- examples:
from tools.common import AttributeManager class SomeClass: __slots__ = ('__private_attr', '_protected_attr', 'public_attr') ... def as_static(self, attr_name: str): mangled_name = AttributeManager.get_name(obj=self, attr=attr_name) print(f'attribute_mangled_name: {mangled_name}') # found = AttributeManager.has_attribute(obj=self, attr=attr_name) print(f'found: {found}') # if not found: AttributeManager.set_attribute(obj=self, attr=attr_name, value=None) # value = AttributeManager.get_attribute(obj=self, attr=attr_name) print(f'value: {value}') pass def as_instance(self, attr_name: str): attr = AttributeManager(obj=self, attr=attr_name) # mangled_name = attr.name print(f'attribute_mangled_name: {mangled_name}') # found = attr.exists print(f'found: {found}') # if not found: attr.value = None # value = attr.value print(f'value: {value}') pass ... pass
Hide Big Content
This method tries to hide big content over a limit of characters.
- examples:
from tools.common import hide_big_content content = { 'key': 'value', 'l': [1, 'a', 'b'], 's': 'aaa', 't': (1, 2, 'a' * 5000) } print(f'content: {content}') processed = hide_big_content(value=content) print(f'processed: {processed}')
Mask password
This method tries to mask passwords from provided object.
- examples:
from tools.common import mask_password content = [ 1, 2, True, { 'password': '12345', 'pwd': 'x56', 'pwd_lst': ['123', '345', '567'] } ] print(f'content: {content}') processed = mask_password(value=content) print(f'processed: {processed}')
Get Location
Try to resolve file / method location. Can be used for template relative location
- examples:
from tools.common import get_location def func(): pass func_location = get_location(func=func) print(f'func_location: {func_location}') file_location = get_location(file=__file__) print(f'file_location: {file_location}')
Folders
This module was created to manage main folder operations.
- examples:
from tools.folders import Folder path = 'path/to/folder' if not Folder.exists(path=path): Folder.create(path='path/to/old-folder', recursive=True) Folder.remove(path='path/to/new-folder', recursive=True)
Files
This module was created to perform main file operations.
- examples:
from tools.files import File path = 'path/to/file' name = 'file-name.ext' if not File.exists(path=path, name=name): File.write(path=path, name=name, content=None) demo = File.read(path=path, name=name) print(f'Demo file: {demo}') locked = File.lock(path=path, name=name) print('File is locked') try: File.write(path=path, name=name, content=b'new-content') except Exception as exc: print(f'Something got wrong: {exc}') File.unlock(file=locked) print('File is free to use') File.remove(path=path, name=name)
Tables
This module was created to store data as a table, with data / column validation and filtering. Cells can be accessed by index or by key.
- examples:
from tools.tables import Table table = Table( table={ 'columns': ['col-1', 'col-2'], 'data': [ # row-1 {'col-1': 1, 'col-2': 2}, # row-2 {'col-1': True, 'col-2': 'str'} ] } ) print(f'table: {table}') filtered_1 = table.filter(exclude=('col-1',)) print(f'filtered_1: {filtered_1}') filtered_2 = table.filter(include=('col-2',)) print(f'filtered_2: {filtered_2}')
Metadata
Release files for ruth-tools 2022.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 14.9 MB
Release files / ruth_tools-2022.1.0-cp313-cp313-win_amd64.whl
| Download URL | ruth_tools-2022.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 250.6 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ca364862b6bbf13385405698d1af25cbcf9759b465e2792420d2632ca866f26c
|
|
BLAKE2b-256 checksum How to use checksums |
e68070e5dc8169ea56fd646fc73a0f44f5624ad71b1d1050b8f3cb8419dc3b68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
796bb972ad145a401db449875542f3434d3d84b8a243e3b428aecf9cfa29339f
|
|
BLAKE2b-256 checksum How to use checksums |
4d3374ec625d326dc19590d10cc040f3848a72e50bc0971da2b2246b0187145b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp313-cp313-musllinux_1_2_i686.whl
| Download URL | ruth_tools-2022.1.0-cp313-cp313-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
c4a09b8bc1a89281272fd6f09c386b38a3d2dde0f0416fe20dd70762451e5524
|
|
BLAKE2b-256 checksum How to use checksums |
82f95ab350e0bb5336aa70e22fa21810df74bcc26731765a4959d83164469dc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1f2585501858406a3320c59f90d95c66b636b2ccd3cbce90421d82270f09dc8e
|
|
BLAKE2b-256 checksum How to use checksums |
4c298ccf15bc2e952067a4977f2e62281603511c90ea6b3ecedfedffa46e24e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | ruth_tools-2022.1.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 266.8 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c2fd92402ac60dbd37d27dddada2258c44c64d26c49d2cdc3975062797e081de
|
|
BLAKE2b-256 checksum How to use checksums |
f504cb7c34509dc46dd94d89c8c4f6ce3363bb4d9fd649030c33e1e30b3400a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp312-cp312-win_amd64.whl
| Download URL | ruth_tools-2022.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 253.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
94ef2b51f0a6339ba0059abbf4bcc74e1a23e5f4a02142b8d1e21fcdf589e125
|
|
BLAKE2b-256 checksum How to use checksums |
58e034aa6f2b0ab36efdbf94d9420f28192b89c658dbce295059964728ed5194
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
2107b28e37c2bfe0530af4608511fab5390bc187864d3c3e30cdcbfb71fe8ecc
|
|
BLAKE2b-256 checksum How to use checksums |
466a3df1a366578d480e4d5f0761cdb6929c300ae3b770159e22a0cdbddd310f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp312-cp312-musllinux_1_2_i686.whl
| Download URL | ruth_tools-2022.1.0-cp312-cp312-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
837c2fabf41d4a7576539956a27b9341914239156979d271163726de27f406d0
|
|
BLAKE2b-256 checksum How to use checksums |
0ecdf8232d161680ff1e7042cfcdc0c1422c0dc25a7805e0f3941ed73b5e91d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4889f6ca9c775c18ef1b42f1ab6d4271f125882d6e612279a12241ca50882952
|
|
BLAKE2b-256 checksum How to use checksums |
49b0d54aea3e0507a07ca306b681ec243c5319299d9c10a3a7ddedb5a5d37b5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ruth_tools-2022.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 269.8 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a77c0dd7f2d0611571b657b15e0c72501397a47f0826dcc177446a6fa4487002
|
|
BLAKE2b-256 checksum How to use checksums |
a8c36b4bcfb47dfdcc841352fcf48e5b44e0659b47fe11ca6e811b9fe70f7ea8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp311-cp311-win_amd64.whl
| Download URL | ruth_tools-2022.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 255.8 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
769443f81d9672eafd14d9808f38d731ef9ce54a4ad8fb562f1eac74fd719cf8
|
|
BLAKE2b-256 checksum How to use checksums |
7b6faa08f91727d7cdbd55ec2951c782e339a3c1e05c35d6ca582bab19e6564d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
3e76b7d58e37afb5f590747cd1d429829f24aaaf6059758d35bca3747885e033
|
|
BLAKE2b-256 checksum How to use checksums |
9b5996508f0fb65067dc6a97bcbe5a216e7e9d8a94dde58e86a1dec75ec26cf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp311-cp311-musllinux_1_2_i686.whl
| Download URL | ruth_tools-2022.1.0-cp311-cp311-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
ff8b09c57cc762976a99cbb23070533f1843a22196d0848808f11d642e3160ed
|
|
BLAKE2b-256 checksum How to use checksums |
a8ccef21c0de9ea943cbf48f71fe2c91fcb7692f5e6214966265239ffba25eb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ruth_tools-2022.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
00a7aa77052444d9aa9f7b1b47f32e9182f512874ec89386e075217d7c63b321
|
|
BLAKE2b-256 checksum How to use checksums |
774217e8f1dd027ffeb3221429e2db026b43fe0a92ee979d0659cb58e35d2158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ruth_tools-2022.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | ruth_tools-2022.1.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 269.9 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d2ca0c7039898d1def34539f42f9e1d118e421ae535f4ee0d8a97d127d0f7cc3
|
|
BLAKE2b-256 checksum How to use checksums |
8e6f17556510ea0df60403682b1ede51054404e4b0fdaf1b6456de0872bf2fec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for ruth-tools 2022.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.