Over View
Some own/observed great lib/ideas,common useful python libs/utils.
GitHub https://github.com/txu2008/tlib
PyPI: https://pypi.org/project/tlib
Catalogue
- aws AWS SDK APIs for Python.
- bs Math calculate releated functions.
- data structure Data Structures operations.
- data base Data Base related API/Packages.
- docker docker manager API/Packages.
- es ElasticSearch related test
- fileop File operation related functions
- git Git commands opt; GitLab API
- jenkinslib libs for jenkins
- k8s Kubernetes API.
- log logging config, colored, compress, log file/console.
- ltp Linux Test Project tools
- mail Send email, attachment.
- platform Linux/windows platform operations,such as shell,cmd,ssh_manager...
- vsphere pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter.
- retry Decorators for retry func
- schedule Decorators for schedule the func task and list the tasks with PrettyTable
- storage Object related storage
- Stress Runner A TestRunner generates a HTML report to show the result at a glance.
- utils Some python utils
- validparam Decorators for verify param valid, verify param type, value range, ...
- vim-config A easy vim configuration for python
Quick Start
1. Installation
Install from pip
pip install tlib
Install from source code:
# git clone tlib or download the released tar balls, then:
python setup.py install
2. Doc & Wiki
Visit Wiki to see more details: https://github.com/txu2008/tlib/wiki
Visit Doc site to see py-docs: TODO
Visit examples to see .examples/*
# Examples:
# 1. Init logging logger
from tlib import log
logger = 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. stressrunner
import unittest
from tlib.stressrunner import StressRunner
from test.test_mail import TestMail
runner = 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)
Tests
How 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 request
Discussion
- Github Issues
Reference
* http://tungwaiyip.info/software/HTMLTestRunner.html
WIKI
https://github.com/txu2008/tlib/wiki
Code 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
....
Release files for tlib 1.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tlib-1.2.10.tar.gz | 197.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tlib-1.2.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 496.6 kB
Release files / tlib-1.2.10.tar.gz
| Download URL | tlib-1.2.10.tar.gz |
|---|---|
| Size | 197.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
391eff9cd9932d49bd6c4fc3ebbfcf4dbd2f3944c05046c90153d0dcfde8d891
|
|
BLAKE2b-256 checksum How to use checksums |
fc133e47a95ae70e5da03d8a9b1026419a6aa799910a0c77ac769644caf9127e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|
Release files / tlib-1.2.10-py3-none-any.whl
| Download URL | tlib-1.2.10-py3-none-any.whl |
|---|---|
| Size | 298.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c63c3014232e323e7ea992fc9c966ecc81810d0411f320933ecb7b59873228a8
|
|
BLAKE2b-256 checksum How to use checksums |
15223e9d63ca09b6d239720ea493676d8a3f0b5d5f2163d1b8492a0eaa7f50eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|