Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zzhdbw/light-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


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 - [email protected]

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

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages