Skip to main content

A utility package for Python projects, providing decorators and other utilities.

Project description


Logo

light-util

An light util for python development !

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact

About The Project

light-util is a library that provides lightweight tools for Python development.

(back to top)

Getting Started

You can use it easyly.

Installation

You can install it from pypi by pip.

pip install light-util

(back to top)

Usage

light-util can be used for both synchronous and asynchronous functions.
You can easily use light-util with a decorator.

from light_util import get_time
import time
import asyncio

if __name__ == "__main__":
    @get_time
    async def async_example_function(n):
        time.sleep(2)  # Simulate a delay
        # raise ValueError("An example error")
        return 1
    
    @get_time
    def example_function(n):
        time.sleep(2)  # Simulate a delay
        # raise ValueError("An example error") 
        return 1
    
    import asyncio
    asyncio.run(async_example_function(1000000))    
    example_function(1000000)
    # function [async_example_function] execution elapsed: 2.002s
    # function [example_function] execution elapsed: 2.002s

(back to top)

License

Distributed under the Unlicense License. See LICENSE for more information.

(back to top)

Contact

Zhihao Zhang - 2578503482@qq.com

Project Link: https://github.com/zzhdbw/light-util

(back to top)

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

light_util-0.0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

light_util-0.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file light_util-0.0.1.tar.gz.

File metadata

  • Download URL: light_util-0.0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for light_util-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1b40a631d4a5107b1f75f2a164b1e82651014ce346749632b8b037f3cf3ea02e
MD5 180378492cf444251c663bf662397409
BLAKE2b-256 aa6d849089a89ebfc51813013bd0a3bdcfa6aa14654fd004b971864550b8b330

See more details on using hashes here.

File details

Details for the file light_util-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: light_util-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for light_util-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f22c8f1747cff4fa1e9677965647607347899a89dd289276269005b33f209838
MD5 322a25a0ccaeda870b19ef1c20b0fec1
BLAKE2b-256 3f6ad0b1776bb57164de40957edf252d71e6d13ee5191e59aa8b6cde869ac67a

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