Skip to main content

Some own/observed great lib/ideas,common useful python libs

Project description

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
....

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tlib-1.2.10.tar.gz (197.7 kB view details)

Uploaded Source

Built Distribution

tlib-1.2.10-py3-none-any.whl (298.9 kB view details)

Uploaded Python 3

File details

Details for the file tlib-1.2.10.tar.gz.

File metadata

  • Download URL: tlib-1.2.10.tar.gz
  • Upload date:
  • Size: 197.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for tlib-1.2.10.tar.gz
Algorithm Hash digest
SHA256 391eff9cd9932d49bd6c4fc3ebbfcf4dbd2f3944c05046c90153d0dcfde8d891
MD5 40ebf939d7c7563cfd7f03f9ee51107c
BLAKE2b-256 fc133e47a95ae70e5da03d8a9b1026419a6aa799910a0c77ac769644caf9127e

See more details on using hashes here.

File details

Details for the file tlib-1.2.10-py3-none-any.whl.

File metadata

  • Download URL: tlib-1.2.10-py3-none-any.whl
  • Upload date:
  • Size: 298.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for tlib-1.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c63c3014232e323e7ea992fc9c966ecc81810d0411f320933ecb7b59873228a8
MD5 c8e4ce161a0b27cbf093bf876315693f
BLAKE2b-256 15223e9d63ca09b6d239720ea493676d8a3f0b5d5f2163d1b8492a0eaa7f50eb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page