Skip to main content

A set of useful custom tools that I use a lot

Project description

eclipsetools

PyPI version

eclipsetools is a toolkit for various features I like having for my projects. Although it's intended to be used by me, it offers utilities that anyone might find useful for inclusion in their projects. It is lightweight and easy to integrate!

Features

  • Video Tools: A set of functions like crop, trim, blur, and more for working with video files. All functions that modify files save out a new file and do not alter the original input file.
  • Image Tools: Provides basic image operations such as resizing, cropping, rotation, and adjustments to contrast, hue, and brightness.
  • File Tools: File handling operations including copying directories, reading/writing files, and JSON utilities.
  • Task Tools: Background task management with a tray icon interface for managing long-running or background tasks.

Examples

Video Tools:

from eclipsetools import vt

video_folder_path = "path/to/your/folder"
video_paths = vt.get_videos_in_folder(video_folder_path)

saved_paths = vt.perform_operations(video_paths, [
    vt.Operation.Resize(128, 128, keep_aspect_ratio=True, save_path="*_001"), # the star is the name of the input file
    vt.Operation.Crop(64, 128, save_path="*[_001:_002]"), # this will replace the _001 with _002
    vt.Operation.RotateFlip(90, "h", save_path="*[_002:_final]"), # this will rotate 90 degrees and flip on horizontal axis
])

vt.delete_all_but_last_operation_files(saved_paths) # this will remove all the files that were created besides the final ones

Image Tools: Basically the same as video tools but both "vt" and "it" have different meta functions for getting info from files among other things

from eclipsetools import it

image_folder_path = "path/to/your/folder"
image_paths = it.get_images_in_folder(image_folder_path)

saved_paths = it.perform_operations(image_paths, [
    it.Operation.Resize(128, 128, keep_aspect_ratio=True, save_path="*_001"), # the star is the name of the input file
    it.Operation.Crop(64, 128, save_path="*[_001:_002]"), # this will replace the _001 with _002
    it.Operation.RotateFlip(90, "h", save_path="*[_002:_final]"), # this will rotate 90 degrees and flip on horizontal axis
])

it.delete_all_but_last_operation_files(saved_paths) # this will remove all the files that were created besides the final ones

File Tools:

from eclipsetools import ft

source_folder = "path/to/your/src_folder"
destination_folder = "path/to/your/dest_folder"

ft.copy_directory(source_folder, destination_folder, renaming=[
    ("_001", "_002"),  # replaces all _001 with _002 in all file and folder names
    ("fancy", "dirty"),  # replaces all fancy with dirty in all file and folder names
], 
ignore=[], # list of absolute paths of files or folders from the source folder to ignore
overwrite_files=True,
ignore_files=False # when true this will only copy over folders, no files
)

Task Tools:

from eclipsetools import tt


class ExampleTask(tt.BackgroundTask):
    def __init__(self) -> None:
        super().__init__("ExampleTask")

    def start(self):
        print("Start")

    def update(self):
        from random import random
        print(random())

    def end(self):
        print("End")


service = tt.BackgroundService()
service.add_task(ExampleTask())
service.run()

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

eclipsetools-0.0.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

eclipsetools-0.0.3-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file eclipsetools-0.0.3.tar.gz.

File metadata

  • Download URL: eclipsetools-0.0.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for eclipsetools-0.0.3.tar.gz
Algorithm Hash digest
SHA256 32eee4fa1cb8ae93fd5204b6e96ce6e64c189518251f6616b50c68b74fd0bc5b
MD5 22080c54cec40e0647363c738a83c14a
BLAKE2b-256 ea77253a1cd623ae278656aa7494735bbef800c2cfddb6607c7f307d2188484a

See more details on using hashes here.

File details

Details for the file eclipsetools-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: eclipsetools-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for eclipsetools-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8577df29c630d88865c67987c2dd672d853b8e62ec90a02dbb97258207f2ce1a
MD5 a85736246569136cad404cb741955a26
BLAKE2b-256 6da17ab8cb09ed235937948346fca2da6f31b9dacd39258a686836f37e9b5d41

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