Skip to main content

A collection of common utility functions and scripts

Project description

Common Utils

A collection of common utility functions and scripts for various tasks including:

  • File operations
  • HTTP requests handling
  • Image downloading
  • Shell script execution
  • Task completion management
  • Machine wake functionality
  • WebSocket listening

Installation

pip install thetemani-common-utils

Usage

from common_utils import file_utils, http_wrapper, image_downloader

# File operations
result = file_utils.read_file("path/to/file.txt")
file_utils.write_file("path/to/output.txt", "content")

# HTTP requests
response = http_wrapper.make_request("https://api.example.com/data")

# Image downloading
image_downloader.download_image("https://example.com/image.jpg", "local_image.jpg")

# Shell script execution
from common_utils import shell_scripts_handler
shell_scripts_handler.execute_script("kill-process-at-port.sh", ["8080"])

# WebSocket listening
from common_utils import web_socket_listener
listener = web_socket_listener.WebSocketListener("ws://example.com")
await listener.connect()

Features

  • File Utils: Easy file reading, writing, and manipulation
  • HTTP Wrapper: Simplified HTTP request handling
  • Image Downloader: Efficient image downloading with retry logic
  • Shell Scripts Handler: Execute shell scripts with parameters
  • Task Completion: Async task completion management
  • Wake Machine: Remote machine wake functionality
  • WebSocket Listener: Async WebSocket communication

Requirements

See requirements.txt for a list of dependencies.

License

MIT License

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

thetemani_common_utils-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

thetemani_common_utils-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file thetemani_common_utils-0.1.1.tar.gz.

File metadata

  • Download URL: thetemani_common_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for thetemani_common_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6338f57f5b79420732a2337f7178448deb9ed6b77d2c52a8015f9de73df2336a
MD5 3c50fa67837968c4b4a9c325e087c46f
BLAKE2b-256 26a844979a45f69f9ede0064bc021b663dad47f25f35d5a36b380f2cfc2a64a0

See more details on using hashes here.

File details

Details for the file thetemani_common_utils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for thetemani_common_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e25dadeb71970d4eaba20d7f259b7097153839267fa73d93e1690518a2aa928f
MD5 901b3565c0b186b25bf1001b382da6f5
BLAKE2b-256 617a8c02bca8031082a8557ffc526e3290b4978a365d39551774c1ce5083ba80

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