Skip to main content

inspecta PyPI version Build Status Coverage Status

A colorized object pretty printer - for Python.

Introduction

The default pprint is not human friendly enough - color syntax highlighting to the rescue.

Install

Install using pip:

$ pip install inspecta

Use

Very basic example:

import inspecta

data = {
    'foo': {
        'bar': {
            'baz': [
                {
                    'a': 1,
                    'b': 'two',
                    'c': ('three', 4, 'five')
                }
            ]
        }
    },
    'bar': [1, 2, 3],
    'baz': True
}

print('\n.inspect(data)\n')

print(inspecta.inspect(data))

print('\n.print(data)\n')

inspecta.print(data)

Run this with optional environment variables COLORS / ERROR_COLORS set too truthy or falsy values, so see various error info formatting in terminal.

Something like this (imagine some colorized formatting):

.inspect(data)

{   'bar': [1, 2, 3],
    'baz': True,
    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}


.print(data)

{   'bar': [1, 2, 3],
    'baz': True,
    'foo': {'bar': {'baz': [{'a': 1, 'b': 'two', 'c': ('three', 4, 'five')}]}}}

Test

Clone down source code:

$ make install

Run colorful tests, with only native environment (dependency sandboxing up to you):

$ make test

Run less colorful tests, with multi-environment (using tox):

$ make test-tox

About

This project was mainly initiated - in lack of solid existing alternatives - to be used at our work at Markable.ai to have common code conventions between various programming environments where Python (research, CV, AI) is heavily used.

License

Released under the MIT license.

Release files for inspecta 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inspecta 0.1.3
File Size Uploaded
inspecta-0.1.3.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inspecta 0.1.3
File Interpreter ABI Platform
inspecta-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / inspecta-0.1.3.tar.gz

Download URL inspecta-0.1.3.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17124dfae9b05e6226cc426036aa7736bbdf37d61ae5cc85178474ca9ec3d6c1
BLAKE2b-256 checksum
How to use checksums
74403703630202705f96bd08a32a74ef7772345f7e84109915caeed057eeaff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / inspecta-0.1.3-py3-none-any.whl

Download URL inspecta-0.1.3-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
043b4dc3e6b7727e706e793befcba9981eb00f2b1c012c49f6d9cdcb2c18b15f
BLAKE2b-256 checksum
How to use checksums
03aa5ad8e223fa564d474b465771710b8b7b23896b59651cf115f510bcfda3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page