Skip to main content

A global utility package for all the data sorting and inspection needs.

Project description

๐ŸŒŸ globalutil: Your Global Utility Toolkit ๐Ÿ› ๏ธ

Python Version License

globalutil is a comprehensive utility package for file and folder management, with additional features for building auto training pipeline scripts (ML Pipelines) for Python.

๐ŸŒˆ Features

  • ๐Ÿ“ Directory Inspection: Generate beautiful tree structures of your directories
  • ๐Ÿ” Smart File Sorting: Copy files with ease using powerful wildcard patterns
  • ๐Ÿ”Ž File Search: Find files matching specific criteria across directories
  • ๐Ÿ“Š File Organization: Categorize files based on their types
  • ๐Ÿ”„ Duplicate Detection: Identify and manage duplicate files
  • ๐Ÿ“ Large File Finder: Locate files exceeding specified size thresholds
  • ๐Ÿ“ Metadata Extraction: Extract and display file metadata
  • ๐Ÿ“Š Directory Size Calculator: Calculate total size of directories
  • ๐Ÿงน Empty Directory Cleaner: Identify and remove empty directories
  • ๐Ÿ’พ File Backup: Create timestamped backups of files and directories
  • ๐Ÿ—œ๏ธ File Archiving: Create and extract zip archives
  • ๐Ÿ” File Integrity: Calculate and verify file checksums
  • ๐Ÿ•’ Recent File Finder: Locate recently modified or created files
  • ๐Ÿท๏ธ Batch File Renaming: Rename multiple files based on patterns
  • ๐Ÿ”ง Extensible Design: Built with future expansion in mind
  • ๐Ÿ“ Code Documentation: Generate documentation for your code files
  • ๐Ÿ“– File Reading: Efficiently read files with specific extensions
  • ๐Ÿ” Extension Finding: Identify coding and configuration file extensions in a directory

๐ŸŽฏ Vision

globalutil aims to become the Swiss Army knife of ML-related utility tools, supporting a wide range of file and directory operations!

๐Ÿš€ Quick Start

Installation

pip install globalutil

Usage

Example: Preparing Files for LLM Upload

from globalutil.filesystem import Inspect, Sort, ExtensionFinder
from globalutil.filesystem.operations import FileReader, CodeDocumentation

# Collect all Python files into a single folder
structure = Inspect.generate_copy_structure("./", "./temp")
Sort.copy_structure(structure, patterns=["*.py"])

# Generate a tree structure of your project
tree = Inspect.get_directory_tree(".")
with open("tree.txt", "w") as f:
    f.write(tree)

# Find all coding and config extensions in a directory
extensions = ExtensionFinder.find_extensions("/path/to/your/project")
print("Coding extensions:", extensions.get('coding', set()))
print("Config extensions:", extensions.get('config', set()))

# Read files with specific extensions
allowed_extensions = set.union(
    ExtensionFinder.CODING_EXTENSIONS, 
    ExtensionFinder.CONFIG_EXTENSIONS
)

reader = FileReader(allowed_extensions=allowed_extensions)
all_file_contents = reader.read_files_in_directory("/path/to/your/project")

# Generate documentation for your code
code_doc = CodeDocumentation()
generated_file = code_doc.generate_entire_folder_txt(
    root_directory='/path/to/your/project',
    output_file='/path/to/output/entire_code.txt',
    file_extensions={".py", ".sh"}
)
print(f"Generated documentation file: {generated_file}")

This script demonstrates how to:

  1. Copy all Python files to a temp folder
  2. Generate a tree structure of your project
  3. Find all coding and configuration file extensions in a directory
  4. Read files with specific extensions
  5. Generate documentation for your code

๐Ÿ“š Documentation

For detailed documentation, visit our GitHub Pages.

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŒŸ Show Your Support

If you find this project useful, give it a star on GitHub! โญ


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

globalutil-0.4.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

globalutil-0.4.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file globalutil-0.4.1.tar.gz.

File metadata

  • Download URL: globalutil-0.4.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for globalutil-0.4.1.tar.gz
Algorithm Hash digest
SHA256 828caa6a6e7203052146b65917399e17a06ac12ada80e08028d6675bf153fd04
MD5 c329708bb31ba6a1b348117fb88a8062
BLAKE2b-256 8235191387fef0398903e79e4c608818272167fa9501c37fe6b1a44c89563816

See more details on using hashes here.

File details

Details for the file globalutil-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: globalutil-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for globalutil-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57c7c52a81e3c69801c18eb628d56a89601a9488521e911a8adab948cedaff11
MD5 a412c7d32ba16cbe981657e520d83f93
BLAKE2b-256 4adfb6da7524c67f63087bb4fbe835dc5d3f04c0f1d4e9ae08f55b20370aa819

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