Skip to main content

The Régis Kla Python tools library

Project description

rktools

A general purpose Python library.

[![Build Status][travis-image]][travis-url] [![Downloads Stats][npm-downloads]][npm-url]

rktools is a general purpose Python Library. It is originally designed after the needs of several small tools during Python projects development.

Introduction

The library is organized around dedicated modules for monitoring processes, for loggings events, and so forth:

  • loggers: A simple Python logging wrapper that provide additional features such as http server logging handler management...
  • monitors: A set of monitoring tools to provide visibility to the end user. For instance, it provide ProgressBar which is a tqdm wrapper, and so forth

Install

rktools is currently supported only for Linux systems. However, since it is written with pure Python, it should run without any problem on all platforms.

Using pip

The easiest way to install rktools is using pip to fetch it from Pypi as follows:

$ pip install rktools 

Using rktools

The modules usage is as follows.

Loggers

Import the init_logger function from the rktools.loggers module:

from rktools.loggers import init_logger

Declare and initialize a logger global (or local variable) :

...
logger = init_logger(name="test_monitors", config = config)
...

The returned logger object is an instance of Python logging.Logger class. Also notice that the Python logging package can be required if you want to override the logging level:

import logging
...
logger = init_logger(name="test_monitors", config = config, level = logging.getLevelName("DEBUG"))
...

Use the logger object the same way you use the Python logging.Logger object:

...
logger.debug("A debug message!")
logger.info("A info message!")
logger.warning("A warn message!")
logger.error("A error message!")
logger.critical("A critical message!")
...

Find more details in the reference documentation here.

Monitoring

Import the ProgressBar class from the monitors module:

from rktools.monitors import ProgressBar

Changes

  • 0.0.1
    • Lib creation. Work in progress

Feedback

Open a ticket / fork the project on GitHub, or send me an email at klaregis@gmail.com.

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

rktools-0.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rktools-0.0.1-py2.py3-none-any.whl (8.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rktools-0.0.1.tar.gz.

File metadata

  • Download URL: rktools-0.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for rktools-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ee6a7a0073ca9a222688d974de4be9fe43404b0e9a51fcd632bbc4ef06a3db34
MD5 e01ea13179a24cfac405e63a6a46f560
BLAKE2b-256 4bc453d2b1f9f782dc4e50b110a4fc456a1cd066492378767cca52e4a0314842

See more details on using hashes here.

File details

Details for the file rktools-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: rktools-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for rktools-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb383e56acfcd9606563c849f0b32f1bad9fd23428e84c5b4145abccbd78af20
MD5 24a04b164547dd1d15757878df8b9ce7
BLAKE2b-256 123ec86b2deb1f9887520d2041b19b931f8b06ac4feee2786ad36391aceeebba

See more details on using hashes here.

Supported by

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