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"])

# Async task processing
from common_utils import async_task_processor
async def my_async_task(data):
    # Your async logic here
    pass

async_task_processor.task_processor.add_task(my_async_task, "some_data")

Features

  • Async Task Processor: Queue and process async tasks in a separate thread
  • 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.7.tar.gz (7.8 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.7-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thetemani_common_utils-0.1.7.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for thetemani_common_utils-0.1.7.tar.gz
Algorithm Hash digest
SHA256 447c7ee3fb34b3a085b587ec2710b5a194daa0de185c93da5b74a7053f7a0e9a
MD5 01045e2ea9345a57902c5d636d193735
BLAKE2b-256 2c40833eb8c10956fc259f6979a75b71f707987f2d0cb8abad6b3195e584ecb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for thetemani_common_utils-0.1.7.tar.gz:

Publisher: release.yml on Omer-hadad-s-Projects/common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for thetemani_common_utils-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f3baf82852e060805d3aeeacd897715a4e767d940e5a078d1c6065d5fadac201
MD5 688781b62f6a7a92851741dd77669693
BLAKE2b-256 afa9c65a7a59afcb263285e5bb1d83e5c74a80c31dcdc94566deb543e7b93fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for thetemani_common_utils-0.1.7-py3-none-any.whl:

Publisher: release.yml on Omer-hadad-s-Projects/common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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