No project description provided
Project description
Printt (Detailed print)
Description
This Python library, printt
(printt), offers a convenient way to print detailed information about variables during development and debugging. It leverages the rich library for visually appealing output in your terminal.
Features
- Variable Name Detection: Attempts to automatically identify the variable name using introspection.
- Human-Readable Size Conversion: Converts raw byte sizes of variables into human-readable formats like KB, MB, GB, etc.
- Customizable Printing: Control whether to print the actual variable value or a placeholder message using the
print_variable
flag. - Exception Handling: Gracefully handles potential exceptions during information retrieval, providing informative error messages.
- Rich Formatting: Employs rich library for visually-appealing output in your terminal.
Installation
Install printt
using Poetry:
poetry install printt
Usage
- Import:
from printt import printt
- Print Variable Details:
my_list = [1, 2, 3]
printt(my_list)
This will output details like variable name (if found), class type, size, and results of attempting to call type
, dir
, len
, and a function to calculate memory usage.
Enabling/Disabling Printing
- Enable printing:
from printt import enable_printt
enable_printt()
- Disable printing:
from printt import disable_printt
disable_printt()
Additional Notes
- The automatic variable name detection might not work in all cases.
- Exception handling helps prevent unexpected errors while debugging.
Contributing
We welcome contributions to improve printt
. Please feel free to submit pull requests!
License
This project is licensed under the terms of the MIT License (see LICENSE.md for details).
Project details
Release history Release notifications | RSS feed
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 printt-0.1.2.tar.gz
.
File metadata
- Download URL: printt-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceb9734de8e201b9140aadf2fe72a781550a70b6faeab0e13edb2bd9cba1c586 |
|
MD5 | 0be2431546e7d4e9609fad9e551a8a82 |
|
BLAKE2b-256 | ba58bdb08b1e3dc954924847ecbd604158b48d0bb86161fda11c34c4dffb34d8 |
File details
Details for the file printt-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: printt-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0de87c413fc8de2741b9662e41de80ccba162edb3b66e55acd5f00b1dc60cec4 |
|
MD5 | c7eac60dc8e6d978f9f57af1b770c3fe |
|
BLAKE2b-256 | 38251f8802fd599a1b87063f33f4ed8a331900aa3c57b7f24727bad9fda93111 |