Package: tlib
Over ViewSome own/observed great lib/ideas,common useful python libs/utils.GitHubhttps://github.com/txu2008/tlibPyPI:https://pypi.org/project/tlibCatalogueawsAWS SDK APIs for Python.bsMath calculate releated functions.data structureData Structures operations.data baseData Base related API/Packages.dockerdocker manager API/Packages.esElasticSearch related testfileopFile operation related functionsgitGit commands opt; GitLab APIjenkinsliblibs for jenkinsk8sKubernetes API.loglogging config, colored, compress, log file/console.ltpLinux Test Project toolsmailSend email, attachment.platformLinux/windows platform operations,such as shell,cmd,ssh_manager...vspherepyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter.retryDecorators for retry funcscheduleDecorators for schedule the func task and list the tasks with PrettyTablestorageObject related storageStress RunnerA TestRunner generates a HTML report to show the result at a glance.utilsSome python utilsvalidparamDecorators for verify param valid, verify param type, value range, ...vim-configA easy vim configuration for pythonQuick Start1. InstallationInstall from pippipinstalltlibInstall from source code:# git clone tlib or download the released tar balls, then:pythonsetup.pyinstall2. Doc & WikiVisit Wiki to see more details:https://github.com/txu2008/tlib/wikiVisit Doc site to see py-docs: TODOVisit examples to see .examples/*# Examples:# 1. Init logging loggerfromtlibimportloglogger=log.get_logger(logfile='test1.log',logger_name='test1',debug=True,reset_logger=True)logger.info('test_1 start ...')logger.warning('test_1 hello,world')logger.debug('test_1 hello,world')logger.error('test_1 hello,world')logger.critical('test_1 hello,world')# 2. stressrunnerimportunittestfromtlib.stressrunnerimportStressRunnerfromtest.test_mailimportTestMailrunner=StressRunner(report_path='sr_test.log',title='My unit test with stressrunner',description='This demonstrates the report output by StressRunner.',logger=logger,# support owner logging logger)test_suite=unittest.TestSuite()test_suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestMail))runner.run(test_suite)TestsHow to run test case in this project:
- Run test/test_*.py
- python run_test.py log
- python run_test.py mail
- python run_test.py es stress -h
- python run_test.py es index -h
- ...Contribute To TLIB- Commit code to Github, https://github.com/txu2008/tlib
- Need to check pep8 and pylint rules before you start a pull requestDiscussion- Github IssuesReference* http://tungwaiyip.info/software/HTMLTestRunner.htmlWIKIhttps://github.com/txu2008/tlib/wikiCode directory tree:tlib
    |-- docs                    module              Docments
    |-- examples                module              tlib useage examples   
    |-- test                    module              tlib unit test cases
    |-- tlib                    module              tlib packages
    |-- requirements.txt        module              Python package requirements, pip install -r requirements.txt
    |-- Pipfile                 module              Python packages manage with pipenv
    |-- run_test.py             module              An interface for run unit test, python run_test.py -h
    |-- setup.py                module              Setup
....