This package contains various automotion tools
Project description
mhmixtools
This package provides various automation tools for developers.
Current Features
- template_sync: Automate HTML template updates.
- folder_structure_generator: Simplify the creation of project folder structures.
- image_utils: Utilities for image processing tasks.
- decorators: Handy decorators for Python functions.
Installation
To install the package, use the following command:
pip install mhmixtools
Usage Guide
1. template_sync
This module helps automate updating multiple HTML files with a shared template.
Available Functions:
-
list_html
Lists all.htmlfiles in a project, with options to exclude specific directories and display the results.Function Signature:
list_html(exclude_dirs: list, show: bool = True) -> list
- Parameters:
exclude_dirs(list): Directories to skip while searching for.htmlfiles.show(bool): WhenTrue(default), prints the file locations to the terminal. WhenFalse, returns a list of file paths.
- Returns:
- A list of file paths if
show=False.
- A list of file paths if
Example:
from mhmixtools.template_sync import list_html # List HTML files excluding the 'env' directory and print the results list_html(exclude_dirs=['env']) # Get a list of HTML file paths html_files = list_html(exclude_dirs=['env'], show=False) print(html_files)
- Parameters:
-
render_templates
Updates multiple HTML files by applying a shared template, preserving dynamic content within a specific container.Function Signature:
render_templates(template_url: str, target_files: list, content_id: str, indent: int = 4)
- Parameters:
template_url(str): Path to the shared template file.target_files(list): List of file paths to be updated with the template.content_id(str): Theidof the container element holding dynamic content. Content within this container remains unchanged.indent(int): Indentation level for prettifying the HTML output (default is 4 spaces).
- Returns:
- None. Updates are made directly to the target files.
Example:
from mhmixtools.template_sync import render_templates # Define the template file and target files template_url = "template.html" target_files = [ "file1.html", "file2.html", ] # Define the dynamic content container's ID content_id = "content" # Apply the template with 4-space indentation render_templates(template_url, target_files, content_id, indent=4)
- Parameters:
Notes
- Ensure the
content_idmatches theidattribute of the dynamic content container in your HTML files. - Use
list_htmlto quickly gather all target file paths.
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
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
File details
Details for the file mhmixtools-0.1.tar.gz.
File metadata
- Download URL: mhmixtools-0.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
855272671b28997192b803f47b3366843a587a0800b0d43040ae6d7f13908f29
|
|
| MD5 |
d3813cdff2d3c1254d50603ea514c55e
|
|
| BLAKE2b-256 |
f5ceef9693b6f5fce0c54e2ee327637ba09bbb33a77348f842ebe6162821961f
|
File details
Details for the file mhmixtools-0.1-py3-none-any.whl.
File metadata
- Download URL: mhmixtools-0.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2914ac783b6c010cbc0b236af9f78ff434b4954822905a015201ba6d41b1ec4f
|
|
| MD5 |
ffab744f726ae7b57ac3c6a99b122207
|
|
| BLAKE2b-256 |
023586fa6a1f187239d136a0aacc2c7e23d17bde8fec1aed687c19c19c0e46ee
|