Skip to main content

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

  1. aws AWS SDK APIs for Python.
  2. bs Math calculate releated functions.
  3. data structure Data Structures operations.
  4. data base Data Base related API/Packages.
  5. docker docker manager API/Packages.
  6. es ElasticSearch related test
  7. fileop File operation related functions
  8. git Git commands opt; GitLab API
  9. jenkinslib libs for jenkins
  10. k8s Kubernetes API.
  11. log logging config, colored, compress, log file/console.
  12. ltp Linux Test Project tools
  13. mail Send email, attachment.
  14. platform Linux/windows platform operations,such as shell,cmd,ssh_manager...
  15. vsphere pyVmomi is the Python SDK for the VMware vSphere API that allows you to manage ESX, ESXi, and vCenter.
  16. retry Decorators for retry func
  17. schedule Decorators for schedule the func task and list the tasks with PrettyTable
  18. storage Object related storage
  19. Stress Runner A TestRunner generates a HTML report to show the result at a glance.
  20. utils Some python utils
  21. validparam Decorators for verify param valid, verify param type, value range, ...
  22. 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)

Source distribution for tlib 1.2.10
File Size Uploaded
tlib-1.2.10.tar.gz 197.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tlib 1.2.10
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.10 This release

2 release files

1.2.9

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

1 release file

1.2.4

2 release files

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page