Library of Eclectic Experiments by Tenchi
Project description
LEET
Library of Eclectic Experiments by Tenchi
Random modules that I made and use in several project and are too small to get their own package. A util
library of sorts.
Contents
Logging
Module that provides a fancy-looking theme for Python loggers.
(TODO: Screenshot)
To enable, import leet.logging
from anywhere (maybe the main __init__.py
of your project). You will then have a global logger log
function that you can use from anywhere:
log.info("Hello")
log.warn("World")
If using MyPy (or if you don't like monkeypatching) you can import the logger explicitly in each module as needed:
from leet.logging import log
log.info("Explicit import")
Progress bars
Also provides a progress bar (from WoLpH/python-progressbar) that fits in the theme:
from time import sleep
from leet.logging import log_progress
for i in log_progress.debug(range(10)):
sleep(1)
log.info("Working on %d..." % i)
Images
Also supports outputing images via imgcat if using iTerm2 (support for other tools pending):
log.warn("Image is too big:", extras={"img": "path/to/image.png"})
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
Built Distribution
File details
Details for the file 2xh-leet-1.0.1.tar.gz
.
File metadata
- Download URL: 2xh-leet-1.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.6 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0079cbdf0f7e34caaf07cbd53b11751a95f22aa28f0cca05d0e814137eb8cc63 |
|
MD5 | 6c8f157f2e644212ca7878a294e36778 |
|
BLAKE2b-256 | 08bbfdfd468425f7376fb43f5be6e4d69432deef2b4aa726e897049b9450fd2b |
File details
Details for the file 2xh_leet-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: 2xh_leet-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.6 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1f21fc1726a59d62578eb5926b10bfe49e5c1fa697959bbad8e677f230a0365 |
|
MD5 | 22327bf5f5b785db3004f983b92370e2 |
|
BLAKE2b-256 | ee70ba9c871127fc22479dde5efd3fb0f4cd75d20afa4959958507936dc7df18 |