Skip to main content

TekLeo Common Utils

A python package with shared utils methods that can be used in a variety of python projects, but are mostly tailored towards web / ml applications.

Feel free to drop your suggestions, hopefully one day this will be a pretty comprehensive library of cool shared tools.

Description

Under construction... This shit is boring to write, will finish description and examples when I have more free time.

Utils ID

  • generate_uuid self-explanatory

Utils Image

Conversion between PIL and OpenCV formats. Opening, saving, downloading, encoding images.

  • convert_image_pil_to_image_cv convert PIL image to OpenCV image
  • convert_image_cv_to_image_pil convert OpenCV image to PIL image
  • open_image_pil load PIL image from file
  • open_image_cv load OpenCV image from file
  • save_image_pil save PIL image to file
  • save_image_cv save OpenCV image to file
  • debug_image_cv show a GUI window with an OpenCV image displayed in it
  • download_image_pil download PIL image from url
  • encode_image_pil_as_base64 convert PIL image to base 64 encoded string
  • decode_image_pil_from_base64 convert base 64 encoded string to PIL image

Utils OpenCV

Various OpenCV tools you might commonly need

  • blur_gaussian apply Gaussian blur
  • rotate_bound rotate image bounded, preserving the original dimensions and cutting all rotated content that doesn't fit into original image size
  • rotate_free rotate image freely, changing dimensions to make sure all rotated content fits inside
  • deskew deskew (straighten) image, works best on text images, like page scans and etc.

Utils Random

Random related stuff beyond the default random module

  • get_random_user_agent generate a random User-Agent for HTTP headers (using user_agent library)

UtilsPing

Special utils to generate ping replies. Useful in web services.

  • build generate ping reply object

TODO / next updates

  • Needs a lot of unit tests & usage examples

Installation

Normal installation

pip install tekleo-common-utils

Development installation

git clone https://github.com/jpleorx/tekleo-common-utils.git
cd tekleo-common-utils
pip install --editable .

Links

In case you’d like to check my other work or contact me:

Metadata

Release files for tekleo-common-utils 0.0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tekleo-common-utils 0.0.2.8
File Size Uploaded Provenance Actions
tekleo-common-utils-0.0.2.8.tar.gz 23.6 kB Without provenance Details for tekleo-common-utils-0.0.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tekleo-common-utils 0.0.2.8
File Interpreter ABI Platform Actions
tekleo_common_utils-0.0.2.8-py3-none-any.whl Python 3 none any Details for tekleo_common_utils-0.0.2.8-py3-none-any.whl

Total release size: 50.3 kB

Release files / tekleo-common-utils-0.0.2.8.tar.gz

Download URL tekleo-common-utils-0.0.2.8.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e5b8893299d130044c741aa451d774b36a10ab66e22c6b0395af627cea0f1cbe
BLAKE2b-256 checksum
How to use checksums
60f15b3fa461f2d5ae6505cecf123a27f9e9ed851d6b85388a64448fe128c5eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.6

Release files / tekleo_common_utils-0.0.2.8-py3-none-any.whl

Download URL tekleo_common_utils-0.0.2.8-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8325d95b9a7d069785a19914f742a010dfa06e3a376395894540ddaad0b8c18
BLAKE2b-256 checksum
How to use checksums
057c22fee697f587267a5561baea7c979cdaa310cbf7aaa514028b1e6ccd7527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.6

Security for tekleo-common-utils 0.0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page