A utility package for Python projects, providing decorators and other utilities.
Project description
Table of Contents
About The Project
light-util is a library that provides lightweight tools for Python development.
Getting Started
You can use it easyly.
Installation
You can install it from pypi by pip.
pip install light-util
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
License
Distributed under the Unlicense License. See LICENSE for more information.
Contact
Zhihao Zhang - 2578503482@qq.com
Project Link: https://github.com/zzhdbw/light-util
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b40a631d4a5107b1f75f2a164b1e82651014ce346749632b8b037f3cf3ea02e
|
|
| MD5 |
180378492cf444251c663bf662397409
|
|
| BLAKE2b-256 |
aa6d849089a89ebfc51813013bd0a3bdcfa6aa14654fd004b971864550b8b330
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f22c8f1747cff4fa1e9677965647607347899a89dd289276269005b33f209838
|
|
| MD5 |
322a25a0ccaeda870b19ef1c20b0fec1
|
|
| BLAKE2b-256 |
3f6ad0b1776bb57164de40957edf252d71e6d13ee5191e59aa8b6cde869ac67a
|