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.1.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.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indent_print-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0de6369157d07b698a44f3a49e783794d4b083d1f9d648aa6a0022610467851f
MD5 d928ceb2e07d1f2dee8b74f81a633b0f
BLAKE2b-256 ddda832b548e0c98fef7fa9d899f38aa4617b16e1917748a3e64feef493402d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: indent_print-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 704475aa61d5926be00f909c78a3aef45f0abf98228b48db07644b0206185a70
MD5 5477cb7500ce0011852a879b17e9ff8a
BLAKE2b-256 3d7d88e8d9742c7953e8ae42159cceede4992d0fed69fa18aa9d8b70b426fcb7

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