FOSSLight Util
Project description
FOSSLight Util
It is a package that supports common utils used by FOSSLight Scanner.
Features
- It simplifies the logger setup.
- It easily outputs csv file and excel file in OSS Report format.
- It provides a simple function to create a text file.
Contents
📋 Prerequisite
FOSSLight Util needs a Python 3.6+.
🎉 How to install
It can be installed using pip3.
$ pip3 install fosslight_util
🚀 How to use
Three modules can be called. Please refer to each file for detailed calling method.
1. Setup logger (tests/test_log.py)
from fosslight_util._set_log import init_log
def test():
logger = init_log("test_result/log_file1.txt")
logger.warning("TESTING - Print log")
2. Write csv and excel files (tests/test_excel.py)
from fosslight_util._write_excel import write_excel_and_csv
def test():
sheet_contents = {'SRC':[['run_scancode.py', 'fosslight_source',
'3.0.6', 'Apache-2.0', 'https://github.com/LGE-OSS/fosslight_source', 'https://github.com/LGE-OSS/fosslight_source', 'Copyright (c) 2021 LG Electronics, Inc.', 'Exclude', 'Comment message'],
['dependency_unified.py', 'fosslight_dependency',
'3.0.6', 'Apache-2.0', 'https://github.com/LGE-OSS/fosslight_dependency', 'https://github.com/LGE-OSS/fosslight_dependency', 'Copyright (c) 2020 LG Electronics, Inc.', '', '']],
'BIN':[['askalono.exe', 'askalono',
'0.4.3', 'Apache-2.0', 'https://github.com/jpeddicord/askalono', '', 'Copyright (c) 2018 Amazon.com, Inc. or its affiliates.', '', '']]}
success, msg = write_excel_and_csv(
'test_result/excel/OSS-Report', sheet_contents)
3. Write a text file (tests/test_text.py)
from fosslight_util.write_txt import write_txt_file
def test():
success, error_msg = write_txt_file("test_result/txt/test.txt",
"Testing - Writing text in a file.")
👏 How to report issue
Please report any ideas or bugs to improve by creating an issue in fosslight_util repository. Then there will be quick bug fixes and upgrades. Ideas to improve are always welcome.
📄 License
FOSSLight Util is released under Apache-2.0.
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
fosslight_util-1.0.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for fosslight_util-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33c3b24599a3d73d1ce9c66e4448026910682606ae9a51dab35a417c444e4e6e |
|
MD5 | 42b43f3366b07e517922610947c3c3e1 |
|
BLAKE2b-256 | b124235b15e11db1e5b94779f176a7e59be0a31b79eb514dd991986e039cadb9 |