
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
lk-utils is a set of utilities to make data processing more simple and fluent.
pip install lk-utils
lk-utils requires python 3.8 or higher version.
from lk_utils import new_thread
def main(files: list[str]) -> None:
for f in files:
handle_file(f)
@new_thread()
def handle_file(file: str) -> None:
# do something
...
from lk_utils import new_thread
def main(files: list[str]) -> None:
pool = []
for f in files:
thread = handle_file(f)
pool.append(thread)
...
for thread in pool:
result = thread.join()
print(result)
@new_thread()
def handle_file(file: str) -> str:
# do something
...
from lk_utils import run_cmd_args
from lk_utils import run_cmd_shell
run_cmd_args('python', '-m', 'pip', 'list')
run_cmd_shell('python -m pip list')
advanced filter:
from lk_utils import run_cmd_args
def pip_install(
dest: str,
url_index: str = None
) -> None:
run_cmd_args(
('python', '-m', 'pip'),
('install', '-r', 'requirements.txt'),
('-t', dest),
('-i', url_index),
)
from lk_utils import mklink, mklinks
mklink('/from_dir', '/to_dir_1')
mklinks('/from_dir', '/to_dir_2')
import os
from lk_utils import filesniff as fs
print(fs.currdir() == os.path.dirname(__file__).replace('\\', '/')) # -> True
print(fs.relpath('..') == os.path.dirname(fs.currdir())) # -> True
from lk_utils import filesniff as fs
for path, name in fs.find_files('.'): # this is an generator.
print(path, name)
# the first element is the **abspath**, the second is path's
# basename (<- os.path.basename(path))
for path in fs.find_file_paths('.'): # this is a list[str]
print(path)
for name in fs.find_file_names('.'): # this is a list[str]
print(name)
# more:
# fs.findall_files
# fs.findall_file_paths
# fs.findall_file_names
#
# fs.find_dirs
# fs.find_dir_paths
# fs.find_dir_names
#
# fs.findall_dirs
# fs.findall_dir_paths
# fs.findall_dir_names
from lk_utils import read_and_write as rw
data_r = rw.loads(file_i)
# it recognizes json, yaml, pkl as sturctured data. others are treated as
# plain text.
data_w = ...
rw.dumps(data_w, file_o)
# it recognizes json, yaml, pkl as sturctured data. others are treated as
# plain text.
below are marked as deprecated.
from lk_utils import excel as exl
reader = exl.ExcelReader(file_i)
# accepts '.xls' and '.xlsx' files.
... # TODO:CompleteExample
writer = exl.ExcelWriter(file_o)
# accepts only '.xlsx' files.
... # TODO:CompleteExample
writer.save()
TODO
FAQs
LK Utils is a set of utility wrappers made for data processing.
We found that lk-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.