Skip to main content

Python module with some utils for every day code that I've seen usefull lately while working. Print, print colors, print warnings, print errors, save files, load files, clear bash

Project description

Welcoome to maikol-utils 🧰 V 0.6.4

maikol-utils is a lightweight and reusable Python utility package designed to speed up and clean up your everyday scripting and automation workflows.

Whether you're handling JSON files, managing the file system, cleaning up terminal outputs, or improving logging with colored messages and structured separators — this module brings a collection of practical tools ready to use.

🧑‍💻 Author

Developed by Miquel Gómez – Python developer. Hand-picked utilities from real-world scripting and automation tasks.

Structure

├── LICENSE
├── README.md
├── maikol-utils
│   ├── __init__.py
│   ├── file_utils.py
│   ├── print_utils.py
│   └── time_tracker.py
├── pyproject.toml
├── setup.py
└── usage_examples.ipynb

🚀 Features

  • 🔹 Filesystem helpers: Easily check, load, save, and create files/directories.
  • 🖨️ Colorful terminal prints: Add colored, formatted, or warning messages to your logs.
  • 📜 Visual bash separators: Make your CLI outputs more structured and readable.
  • 🧹 Terminal cleanup: Clear or update printed lines in-place for dynamic feedback.

📦 Installation

Option 1: With pip

  1. With pip: pip install maikol-utils

Option 2: Clonning the repo

  1. Clone it from github: git clone https://github.com/MiquelGomezCorral/maikol-utils

Examples of each function at the repo notebook

📘 Usage

from maikol_utils.print_utils import print_separator, print_warn, clear_bash
from maikol_utils.file_utils import save_json, load_json

# Save data to JSON
save_json("outputs/data.json", {"name": "maikol"})

# Load safely from JSON
data = load_json("outputs/data.json")

# Print a section title with visual separator
print_separator("Processing Data", sep_type="SUPER")

# Warn with color
print_warn("This file is missing some fields!")

# Clean last 2 terminal lines
clear_bash(2)

📚 Functions Overview

🗃 File system

save_json(path, content)  Save Python object to JSON.

load_json(path)  Load JSON or return empty dict if not found.

check_dirs_existance(paths)  Assert if dirs exist.

make_dirs(paths)  Create dirs if not present.

🎨 Terminal Printing

print_separator(text, sep_type)  Print formatted section headers.

print_color(text, color)  Print in red, green, blue, etc.

print_warn(text)  Print warnings wrapped in ⚠️ emojis.

print_status(msg)  Overwrite previous line with dynamic status.

clear_bash(n)  Clear n lines above in terminal.

print_clear_bash(text, n)  Clear then print a new message.

🔧 Roadmap

  • Add async support for I/O.
  • Option to customize color themes.
  • CLI preview tool for bash formatting.

Upload

  • If first time
pip install twine wheel
  • Upload
```bash
rm -fr dist
python -m build
twine upload dist/*

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

maikol_utils-0.6.4.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

maikol_utils-0.6.4-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file maikol_utils-0.6.4.tar.gz.

File metadata

  • Download URL: maikol_utils-0.6.4.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for maikol_utils-0.6.4.tar.gz
Algorithm Hash digest
SHA256 b4f54d5841f09953e647c12f56e0d7fc06f423cf3ed2668af44063bef26dad09
MD5 53a850b5d944e7fbb679b4178e3689b8
BLAKE2b-256 dc3e0a1a21426c21baa3326aa8d9221f6405fb69c0f86cb53df96a9edfb9390f

See more details on using hashes here.

File details

Details for the file maikol_utils-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: maikol_utils-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for maikol_utils-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17882045967418238bf742beccc11b9ec65f74a8a63fe252713e9469f87a10ae
MD5 fb602ce4778e1f1fc8b1cf6dd0edee55
BLAKE2b-256 7115b8591691328d23f04795ee048b7c718f22797af39a147f0c5e590c3e258b

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