library can print better readable code
Project description
IPrint (indent print)
you can use easy like print but this print has indent and color that create better readable for you
where use IPrint?
Debugging learning and, in general, visually inspecting values accurately and easily is very useful.
why use IPrint?
For better display and readability of result of code for humans.
how to install
pip install indent-print
how to use
iprint() for indent print
cprint() for indent and colorize print
status_print() for print all data about instance of class(variable, method, ...)
>>> from iprint import iprint, cprint, status_print
>>> iprint(any_data)
>>> cprint(any_data)
>>> status_print(any_instance)
Example:
class AnotherData:
"""document of test class"""
class_variable = "class_variable_value"
def __init__(self, data):
self.instance_variable = data
def instance_method(self):
pass
@classmethod
def class_method(cls):
pass
@staticmethod
def static_method():
pass
@property
def property_variable(self):
return "property_variable_value"
string_data = "my name is matin"
int_data = 20
another_data = AnotherData()
dict_data = {"auther": "matin ahmadi", "github": "https://github.com/matinprogrammer"}
set_data = {1, 2, 3}
list_data = [string_data, int_data, another_data, dict_data, set_data, [[["test list"]]]]
>>> iprint(list_data)
>>> cprint(list_data)
>>> status_print(another_data, show_dunder_attr=True, colorize=True)
Features:
- indent data you use
- colorize your data
- write data with indent in file so easy
- print all data about instance of class
customize
custom indent length
default indent is 4(its mean 4 white space)
>>> iprint([1], indent=8)
[
1
]
write in file
NOTE: cprint hasn't got file parameter(cant write colorize text in file)
>>> with open(test.txt, "w") as test_file:
iprint(mydata, file=test_file)
change seperator of input data
default seperator is " "(white space)
>>> iprint(1, 2, 3, sep="-")
1-2-3
change end character
default seperator is "\n"(new line)
>>> iprint(1, 2, 3, end="*")
1 2 3*
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file indent_print-1.2.0.tar.gz.
File metadata
- Download URL: indent_print-1.2.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
081c0473ac9512e3e7dd47524ce671d4a489a6f2a52a799489ac85335ad9a592
|
|
| MD5 |
3a759aa77d1e99a57806ec7240921dc5
|
|
| BLAKE2b-256 |
a08159fb15d5ec41d64430494bd3813b7297d44819a1204fda35c3195f70e828
|
File details
Details for the file indent_print-1.2.0-py3-none-any.whl.
File metadata
- Download URL: indent_print-1.2.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a230ffa33bfe4c491da1cbad224703cb41d2fb1f37af4f3022b5e5b1a32fa8
|
|
| MD5 |
6742b31fa9a0cfe478b09f9b23781ed4
|
|
| BLAKE2b-256 |
234f66c2076a4bc9b28882985eeb610e8a2da132745a49e01cc7351cf504465a
|