Skip to main content

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)

Screenshot of example code of iprint

>>> cprint(list_data)

Screenshot of example code of iprint

>>> status_print(another_data, show_dunder_attr=True, colorize=True)

Screenshot of example code of iprint

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

indent_print-1.2.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

indent_print-1.2.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file indent_print-1.2.2.tar.gz.

File metadata

  • Download URL: indent_print-1.2.2.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

Hashes for indent_print-1.2.2.tar.gz
Algorithm Hash digest
SHA256 0a067bb428c522b5f7043730cfdd14004dbcbf045d0379905266cc46486e524f
MD5 855d58fba8d0f839271dcafdc59f5fd9
BLAKE2b-256 4b47cc5697f934467ae4973c3def142a2b0082fbe3e64f6f2f4c674105546598

See more details on using hashes here.

File details

Details for the file indent_print-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: indent_print-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for indent_print-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b39aed0500879cbb64088e269c92e4eb39b6bf8db31430e33ab95f6712eec41
MD5 ec2f5c22f4625418e87807b132c3746d
BLAKE2b-256 8e28de7bbaeeb51bca4f46e8203631c7d5aec4bd27745dbe8f24a3b69d6cc2bb

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